PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Creating Image files - Prolem with Icons

Reply

Creating Image files - Prolem with Icons

 
Thread Tools Rate Thread
Old 09-02-2006, 09:20 PM   #1
=?Utf-8?B?Qm9iIENvc3RlbGxv?=
Guest
 
Posts: n/a
Default Creating Image files - Prolem with Icons


(Also posted on Drawing)

I created a drawing program using VS.NET 2003. I use GDI+ for the graphics.
I also wanted the option of creating Image files using the same painting
software. Here is what I do:

// Create bitmap
Bitmap bmp = new Bitmap(32, 32)

// Get a graphics object
Graphics g = Graphics.FromImage(bmp);

// Create the drawing on the bitmap
DrawOnBitmap(g, ......);

// Save the image to disk
bmp.Save(FileName, imgfmt);

where imgfmt is an ImageFormat property. All the following work:

Bmp, Emf, Gif, Jpeg, Png, Tiff, Wnf.

However, when I try to use ImageFormat.Icon, the file gets created by isn't
recognized by VS.NET and is brought up in a VS hex editor. I compared this
file with one supplied with the system and noticed a significant difference
in file size. Mine was 192 bytes whereas the system supplied ico file was
1078 bytes.

Any ideas greatly appreciated.

Bob Costello

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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