Save BitMap as Icon

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I give up...I have tried all combinations that I can think of and I can't get
a bitmap converted to an icon and save it in a filestream or stream;

Any help would be appreciated.
 
Hi,

Dim bm As New Bitmap("C:\Camera.bmp")

Dim ico As Icon = Icon.FromHandle(bm.GetHicon)

Dim fs As New System.IO.FileStream("C:\Camera.ico", IO.FileMode.CreateNew)

ico.Save(fs)

fs.Close()



Ken

-------------------------------

I give up...I have tried all combinations that I can think of and I can't
get
a bitmap converted to an icon and save it in a filestream or stream;

Any help would be appreciated.
 
Ken,

Looks great can this be seen as your code, because I have put it in a
snippet with your name.

Cor
 
Thanks a lot..I've been working on this for 2 days now. I wonder why this
doesn't work?

Dim fmt As ImageFormat
fmt = ImageFormat.Icon
im2.Save("c:\icon1.ico", fmt)

It give an error that value cannot be null, Parameter Encoder.
 
Hi,

Dim bm As New Bitmap("c:\camera.bmp")

bm.Save("C:\Camera.ico", Imaging.ImageFormat.Icon)



Ken

---------------------------------------

Thanks a lot..I've been working on this for 2 days now. I wonder why this
doesn't work?

Dim fmt As ImageFormat
fmt = ImageFormat.Icon
im2.Save("c:\icon1.ico", fmt)

It give an error that value cannot be null, Parameter Encoder.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Extract Icon 7
Icon vs BitMap 2
Bitmap to Icon 6
I want to save pictures (bitmap-graphics) 1
Creating icons 1
Bitmap problems in VB.net 3
Icon Chalange 2
Save bmp/jpg/png...to icon (16x16) - Problem.. 3

Back
Top