
GIFs as Embedded Resources
Greetings!
I have the following code to use icons from embedded resources that works:
Dim st As System.IO.Stream
Dim a As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
st = a.GetManifestResourceStream("TimeKeeper.timer_on.ico")
icnOn = New System.Drawing.Icon(st)
What I need to do now is to embed a GIF image as an embedded resource so I
can put it on a form, but the same premise no longer works:
Dim a As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
Dim st As System.IO.Stream
st = a.GetManifestResourceStream("TimeKeeper.Plain-Logo.gif")
picLogo.Image = System.Drawing.Image(st)
I get an error on the System.Drawing.Image part of the last line that says
"'Image' is a type in 'Drawing' and cannot be used as an expression."
I'm trying to put the gif into a picture box on my form. Should I be using
some other kind of control other than a picture box or something?
Thanks!
Russ