|
-
Apr 30th, 2009, 06:11 PM
#1
Thread Starter
New Member
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.
-
May 16th, 2009, 09:18 PM
#2
New Member
Re: mobile application-Images as background-
Maybe you could just use a PictureBox as a background? It's crude, but pretty effective.
-
May 17th, 2009, 10:03 AM
#3
Frenzied Member
Re: mobile application-Images as background-
-
May 17th, 2009, 04:51 PM
#4
New Member
-
Jun 4th, 2009, 03:51 PM
#5
Member
Re: mobile application-Images as background-
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|