Pleease reference this thread:
http://www.thescripts.com/forum/thread596738.html
Size your Pic file to .5 x .5 inches. (for some reason this was necessary.)
You can use Microsoft Photo Editor or Photoshop for editing/cropping.
Here's the C# code:
this.Icon = Icon.FromHandle(new Bitmap(Bitmap.FromFile(YourFilePath_PIC)).GetHicon ());
Stream st = new FileStream(YourFilePath_ICO, FileMode.Create);
this.Icon.Save(st);
YourFilePath_PIC would be like @"c:\test\myimage.bmp"
YourFIlePath_ICO would be like @"c:\test\myimage.ico"
Hope this helps,
David