Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Extracting Images from Icons

RSS
Modified on Fri, Feb 05, 2010, 12:45 PM by Administrator Categorized as ┬ĚNet Framework
Given a Test.ico file with two images — a 16x16 and a 32x32 — here's how to programmatically extract either image from the ICO file.

To extract the 16x16 image
string iconFile = "Test.ico";
Icon ico = new Icon(iconFile, 16, 16);
this.pictureBox1.Image = ico.ToBitmap();

To extract the 32x32 image
string iconFile = "Test.ico";
Icon ico = new Icon(iconFile, 32, 32);
this.pictureBox1.Image = ico.ToBitmap();

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2018, Patrick Jasinski.