Home All Groups Group Topic Archive Search About

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

Author
16 Dec 2005 1:08 PM
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

Author
16 Dec 2005 2:52 PM
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:q37QzlVJYK4J:www.codeproject.com/aspnet/AssociatedIconsImage/AssociatedIcons.zip


Show quote
"Edwin Knoppert" <n***@hellobasic.com> schreef in bericht
news:43a2bca6$0$10091$ba620dc5@text.nova.planet.nl...
>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
>
>

AddThis Social Bookmark Button