ICO to tranparent gif, here is a incorreclty working project, please help.

E

Edwin Knoppert

I have tried to convert transparent icons to transparent gif's.
I'm not succesful.

Could you check the (running) project and possibly give some corrections?

I think i need to obtain both images and make my own loop.
I have the feeling this code is not working as intended.
The transparancy works but it strips desired pixels as well.

Thanks.

http://s54.yousendit.com/d.aspx?id=16YB2ZWJ8Z1833GGAX8N64U13D
 
E

Edwin Knoppert

Wel, i found some other code, seems transparency does not work that well in
IE but here is transparency code for ico to gif.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim c As New Class1
Dim ico As New System.Drawing.Icon(Server.MapPath("~/images/form.ico"))
'Dim oColor As Color = Color.Transparent
Dim oColor As Color = Color.White
Dim bmp As System.Drawing.Bitmap = ico.ToBitmap
Dim g As Graphics = Graphics.FromImage(bmp)
'bmp.MakeTransparent(oColor)
g.Clear(oColor)
g.DrawIcon(ico, New Rectangle(0, 0, ico.Width, ico.Height))
If bmp Is Nothing Then
Response.Write("BMP not created!")
Else
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "image/gif"
'Dim m As New System.IO.MemoryStream
'bmp.Save(m, ImageFormat.Gif)
'Response.BinaryWrite(m.GetBuffer)
bmp.Save(Response.OutputStream, ImageFormat.Gif)
bmp.Dispose()
bmp = Nothing
End If
ico.Dispose()
ico = Nothing
End Sub

Here is the link i found:
http://66.249.93.104/search?q=cache...pnet/AssociatedIconsImage/AssociatedIcons.zip
 

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