Icon to Bitmap in C# Winforms.

Posted by Peermohamedmydeen under Windows Forms category on | Points: 40 | Views : 10288
Hi All,

The below code snippet will help you to convert an Icon to Bitmap.

public static Bitmap ConvertFromIconToBitmap(Icon ic,Size sz)

Bitmap bmp = new Bitmap(sz.Width, sz.Height);
using(Graphics gp = Graphics.FromImage(bmp))
gp.DrawIcon(ic, new Rectangle(0,0,sz.Width,sz.Height));
return bmp;

Comments or Responses

Login to post response