mobile application-Images as background-
Hi all,
i'm working on .NET Compact Framework using VB.
i found this code, it puts the image as a background on the form.
HTML Code:
Protected Overrides Sub OnPaint(e As PaintEventArgs)
' Get image compiled as an embedded resource.
Dim asm As Assembly = Assembly.GetExecutingAssembly()
Dim backGroundImage As New Bitmap(asm.GetManifestResourceStream("mypicture.bmp"))
e.Graphics.DrawImage(backgroundImage, Me.ClientRectangle, _
New Rectangle(0, 0, backgroundImage.Width, backgroundImage.Height), _
GraphicsUnit.Pixel)
End Sub
this code is giving me an error: no valid namespace.
any help?
and is this code useful to load an image that is stored outside as a background?
thanx.
Re: mobile application-Images as background-
Maybe you could just use a PictureBox as a background? It's crude, but pretty effective.
Re: mobile application-Images as background-
Re: mobile application-Images as background-
Ok, thanks. :) I didn't notice the other thread. :D
Re: mobile application-Images as background-
Quote:
Originally Posted by
ranabis
' Get image compiled as an embedded resource.
Dim asm As Assembly = Assembly.GetExecutingAssembly()
Dim backGroundImage As New Bitmap(asm.GetManifestResourceStream("mypicture.bmp"))
I had similar issue and it turned out to be the "path" to the image. For example my image was stored in a folder named images and so the path was:
...As New Bitmap(asm.GetManifestResourceStream("images/picture.bmp"))
HTH, Magohn