WinCopies.IconExtractor
1.0.3-rc
IconExtractor/IconUtil Library for .NET
Install-Package WinCopies.IconExtractor -Version 1.0.3-rc
dotnet add package WinCopies.IconExtractor --version 1.0.3-rc
<PackageReference Include="WinCopies.IconExtractor" Version="1.0.3-rc" />
paket add WinCopies.IconExtractor --version 1.0.3-rc
#r "nuget: WinCopies.IconExtractor, 1.0.3-rc"
IconExtractor
Icon Extractor Library for .NET
http://www.codeproject.com/Articles/26824/Extract-icons-from-EXE-or-DLL-files
For release notes, see https://wincopies.com/fwd.php?id=13
Extract all the variations of an icon from .DLL/.EXE, including the ones ExtractIconEx()
can't extract.
Usage
First, add a reference to IconExtractor.dll
to your .NET project. Then...
using System;
using System.Drawing;
using TsudaKageyu;
// -----------------------------------------------------------------------------
// Usage of IconExtractor class:
// Construct an IconExtractor object with a file.
IconExtractor ie = new IconExtractor(@"D:\sample.exe");
// Get the full name of the associated file.
string fileName = ie.FileName;
// Get the count of icons in the associated file.
int iconCount = ie.Count;
// Extract icons individually.
Icon icon0 = ie.GetIcon(0);
Icon icon1 = ie.GetIcon(1);
// Save icons individually.
using (var fs = File.OpenWrite(@"D:\sample0.ico"))
{
ie.Save(0, fs);
}
// Extract all the icons in one go.
Icon[] allIcons = ie.GetAllIcons();
// -----------------------------------------------------------------------------
// Usage of IconUtil class:
// Split the variations of icon0 into separate icon objects.
Icon[] splitIcons = IconUtil.SplitIcon(icon0);
// Convert an icon into bitmap. Unlike Icon.ToBitmap() it preserves the transparency.
Bitmap bitmap = IconUtil.ToBitmap(splitIcon[1]);
// Get the bit count of an icon.
int bitCount = IconUtil.GetBitCount(splitIcon[2]);
IconExtractor
Icon Extractor Library for .NET
http://www.codeproject.com/Articles/26824/Extract-icons-from-EXE-or-DLL-files
For release notes, see https://wincopies.com/fwd.php?id=13
Extract all the variations of an icon from .DLL/.EXE, including the ones ExtractIconEx()
can't extract.
Usage
First, add a reference to IconExtractor.dll
to your .NET project. Then...
using System;
using System.Drawing;
using TsudaKageyu;
// -----------------------------------------------------------------------------
// Usage of IconExtractor class:
// Construct an IconExtractor object with a file.
IconExtractor ie = new IconExtractor(@"D:\sample.exe");
// Get the full name of the associated file.
string fileName = ie.FileName;
// Get the count of icons in the associated file.
int iconCount = ie.Count;
// Extract icons individually.
Icon icon0 = ie.GetIcon(0);
Icon icon1 = ie.GetIcon(1);
// Save icons individually.
using (var fs = File.OpenWrite(@"D:\sample0.ico"))
{
ie.Save(0, fs);
}
// Extract all the icons in one go.
Icon[] allIcons = ie.GetAllIcons();
// -----------------------------------------------------------------------------
// Usage of IconUtil class:
// Split the variations of icon0 into separate icon objects.
Icon[] splitIcons = IconUtil.SplitIcon(icon0);
// Convert an icon into bitmap. Unlike Icon.ToBitmap() it preserves the transparency.
Bitmap bitmap = IconUtil.ToBitmap(splitIcon[1]);
// Get the bit count of an icon.
int bitCount = IconUtil.GetBitCount(splitIcon[2]);
Dependencies
-
.NETFramework 4.7.2
- WinCopies.WindowsAPICodePack.Win32Native (>= 2.0.0-preview6)
-
.NETStandard 2.0
- System.Drawing.Common (>= 4.6.0)
- System.Reflection.Emit.ILGeneration (>= 4.6.0)
- System.Reflection.Emit.Lightweight (>= 4.6.0)
- WinCopies.WindowsAPICodePack.Win32Native (>= 2.0.0-preview6)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version History
Version | Downloads | Last updated |
---|---|---|
1.0.3-rc | 209 | 5/6/2020 |