Icon problem in .NET

M

Mat

I have icons, which i always use in VB6 but now in .NET, i can read error
"Code generation for property 'ImageStream' failed. Error was: 'Bitmaps
that are Icons can not be made transparent. Icons natively support
transparency. Use the Icon constructor to create an Icon.'


I don't understand what is wrong....

Please help
 
K

Ken Tucker [MVP]

Hi,

Try something like this.

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

Dim ptrIco As IntPtr = bm.GetHicon

Dim ico As Icon

ico = Icon.FromHandle(ptrIco)



Ken
 
H

Herfried K. Wagner [MVP]

* "Mat said:
I have icons, which i always use in VB6 but now in .NET, i can read error
"Code generation for property 'ImageStream' failed. Error was: 'Bitmaps
that are Icons can not be made transparent. Icons natively support
transparency. Use the Icon constructor to create an Icon.'

What exactly are you doing? Post the code which raises this
exception/error.
 
M

Mat

no Code.
i just add imagelist from toolbox to the form.
in design mode, i add two icons to the images collection.
but when i click ok or compile the application i receive the above error
 

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

Top