IconExtractor.dll 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package IconExtractor.dll --version 1.0.1                
NuGet\Install-Package IconExtractor.dll -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IconExtractor.dll" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IconExtractor.dll --version 1.0.1                
#r "nuget: IconExtractor.dll, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IconExtractor.dll as a Cake Addin
#addin nuget:?package=IconExtractor.dll&version=1.0.1

// Install IconExtractor.dll as a Cake Tool
#tool nuget:?package=IconExtractor.dll&version=1.0.1                

IconExtractor

Icon Extractor Library for .NET

http://www.codeproject.com/Articles/26824/Extract-icons-from-EXE-or-DLL-files

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]);
Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on IconExtractor.dll:

Repository Stars
terrymacdonald/DisplayMagician
DisplayMagician is an open source tool for automatically configuring your displays and sound for a game or application from a single Windows Shortcut.

System requirements:
.NET Framework version: 4.8
OS: Windows
New in this version:
Added some features and updated project to the new .NET and code specifications
Project link: https://github.com/pierresprim/IconExtractor
License link: https://github.com/pierresprim/IconExtractor/blob/master/LICENSE.txt