That would not work but..
i already converted to bmp and i used that code.
But the backcolor remains black while i added:
Dim bmp As Bitmap = ico.ToBitmap
bmp.MakeTransparent(Color.Black)
Return bmp
The image remains the same though.
Better see a real example with a transparent ico > gif.
Your suggestion:
For the type i used: x.ConvertTo(ico, bmp.GetType)
But i don't know what to use to draw to user, and even to expect a
transparent gif since i still use a bitmap object (GIF is bitmap so i should
give it a chance).
Currently the BMP is shown:
Response.ContentType = "image/gif"
Dim xx As System.Drawing.Imaging.ImageFormat
' send the image to the viewer
bmp.Save(Response.OutputStream, xx.Gif)
bmp.Dispose()
Response.End()
"Daniel Fisher(lennybacon)" <(E-Mail Removed)> schreef in bericht
news:Olcg11y%(E-Mail Removed)...
> Have you tried typeof(Bitmap) ?
>
> --
> Daniel Fisher(lennybacon)
> http://www.lennybacon.com
>
>
> "Edwin Knoppert" <(E-Mail Removed)> wrote in message
> news:4396d335$0$2340$(E-Mail Removed)...
>> I'm trying to convert an icon handle to GIF.
>>
>> Something like:
>> Public Function GetImageFromIconHandle(ByVal hIcon As Int32) As Int32
>> Dim ico As Icon = Icon.FromHandle(hIcon)
>> Dim x As New Drawing.IconConverter
>> 'x.ConvertTo(ico,typeof(System.Drawing.Imaging.ImageFormat.Gif) )
>> End Function
>>
>> x.ConvertTo(ico, <requires a system.type> )
>>
>> I don't know how to do that.
>> Important is that a transparent icon should remain transparent.
>>
>> hIcon is a valid 16x16 icon.
>>
>>
>
>