IT Community - Software Programming, Web Development and Technical Support

Can anyone know a Simple method to convert a bitmap to icon using c# dot net?

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?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-22-2007, 11:16 PM
Archer Archer is offline
D-Web Programmer
 
Join Date: Jun 2007
Posts: 52
Archer is on a distinguished road
Question Can anyone know a Simple method to convert a bitmap to icon using c# dot net?

Can anyone know a Simple method to convert a bitmap to icon using c# dot net?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-22-2007, 11:31 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: Can anyone know a Simple method to convert a bitmap to icon using c# dot net?

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();
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 11:54 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0