p.Save(fileName, Imaging.ImageFormat.Icon) does not produce an icon file

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Private Sub SaveBitmap(ByVal fileName As String, ByVal p As
System.Drawing.Bitmap)
...snip

p.Save(fileName, Imaging.ImageFormat.Icon)

Does not produce an icon formatted file.

At least if I try to open it with icon reading programs it does not open.



Is this a know bug?

Are my expectations wrong?



Thanks in advance
 
p.Save(fileName, Imaging.ImageFormat.Icon)
Does not produce an icon formatted file.

ImageFormat.Icon may be used to decode an icon file not create one as there
is no Icon encoder in gdiplus.
At least if I try to open it with icon reading programs it does not open.

That is the expected result as you there is no encoder for the .ico format.
Is this a know bug?
No.


Are my expectations wrong?

Yes. Take a look at the image encoders and decoders on MSDN. You may read
..ico files but not write them with the System.Drawing.Bitmap.
 
thanks

Michael Phillips said:
ImageFormat.Icon may be used to decode an icon file not create one as
there is no Icon encoder in gdiplus.


That is the expected result as you there is no encoder for the .ico
format.


Yes. Take a look at the image encoders and decoders on MSDN. You may
read .ico files but not write them with the System.Drawing.Bitmap.
 
Back
Top