The following code shows how to convert an Icon to Image:
Icon a = new Icon("c:\\myicon.ico");
Image im = a.ToBitmap();
The following code shows how to convert an Image to an Icon:
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap("c:\\myimage.gif"); System.IntPtr iconHandle = bmp.GetHicon();
Icon icon = System.Drawing.Icon.FromHandle(iconHandle);
© 2024 Digcode.com