This is a discussion on Can anyone know a Simple method to convert a bitmap to icon using c# dot net? within the C# Programming forums, part of the Software Development category; Can anyone know a Simple method to convert a bitmap to icon using c# dot net?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi.. I'll tell u the simple method for that.. public void BitmapToIcon(string sourceFileName, string destFileName) { // Create a Bitmap object from an image file. Bitmap bmp = new Bitmap(sourceFileName); // Get an Hicon for myBitmap. IntPtr Hicon = bmp.GetHicon(); // Create a new icon from the handle. Icon newIcon = Icon.FromHandle(Hicon); //Write Icon to File Stream FileStream fs = new FileStream(destFileName, FileMode.OpenOrCreate); newIcon.Save(fs); fs.Close(); } |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is the difference between Convert.toString and .toString() method in asp.net? | oxygen | ASP and ASP.NET Programming | 3 | 01-05-2008 01:34 AM |
| How to Place Icon In URL | velhari | HTML, CSS and Javascript Coding Techniques | 1 | 11-28-2007 06:56 AM |
| Bitmap checkpoints | Shanthi | Testing Tools | 1 | 08-10-2007 06:08 AM |
| How to convert 8-bit bitmap to 24-bit bitmap? | theone | Mobile Software Development | 1 | 07-30-2007 03:46 AM |
| How to convert 8-bit bitmap to 24-bit bitmap? | theone | C# Programming | 1 | 07-19-2007 12:58 AM |