Re: GIF image on a form



Hi Fred

Ah, looks like exactly what I need!!!

However, bit of newbie so need help in exactly what to do. Could I trouble
you to give the steps I need?

G

"Fred Hedges" <dontlike@xxxxxxxxxxxx> wrote in message
news:e4ko8g$362$1$830fa17d@xxxxxxxxxxxxxxxxxxx
What you need to do is make a user control and then modify it's
transparent property on window construction. You then need to handle
"InvalidateEx" messages in order to force the parent to redraw your
background, rather than you. Funny you mention this because I had to do
this with a "working....." animation yesterday.

This sample is in C# but it's easy to convert. You won't be needing a
picture box. Just use DrawImage to render your GIF on the control surface
but overriding the paint event.

http://www.devnewsgroups.net/link.aspx?url=http://dotnet.mvps.org/dotnet/faqs/?id=transparentcontrol&lang=en%3E



"G .Net" <nodamnspam@xxxxxxxxx> wrote in message
news:JfqdnbvL_-z4fPDZRVnyiA@xxxxxxxxxxxx
Hi

I have a form on which I have a picture box. I have placed a GIF as the
image for this picture box. The GIF has a transparent background.

If I change the background color of the form, then the GIF appears on the
form correctly i.e. the background of the form shows through the
transparent part of the gif.

However, if I place a BackgroundImage on the form, the transparent part
of the form does not show the BackgroundImage of the form, rather is
shows the back color of the form. This obviously make the GIF not to be
"transparent".

Can anybody help?

Thanks

G





.



Relevant Pages

  • Re: GIF image on a form
    ... Protected Overrides Sub OnPaintBackground ... better off looking for some picture control to take care of that for you. ... Just use DrawImage to render your GIF on the control ... The GIF has a transparent background. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: GIF image on a form
    ... Protected Overrides Sub OnPaintBackground ... better off looking for some picture control to take care of that for you. ... Just use DrawImage to render your GIF on the control ... The GIF has a transparent background. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: GIF image on a form
    ... Protected Overrides Sub OnPaintBackground ... better off looking for some picture control to take care of that for you. ... Just use DrawImage to render your GIF on the control ... The GIF has a transparent background. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: make image transparent
    ... For a .gif file with a transparent color, ... > Dim imageAttr As New ImageAttributes ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: make image transparent
    ... All I want to do in this case, is make white the transparent colour. ... Dim intwidth As Integer = 100 ... > 1) For a .gif file with a transparent color, ... >> Dim imageAttr As New ImageAttributes ...
    (microsoft.public.dotnet.framework.drawing)