Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I defined a png picture to background for my form.

The pictures comes from resources.

 

When I compile, the background doesn't change !

 

I don't understand why.

 

Is back color parameter must be modified ?

 

Thanks for the help.

 

Pascal T.

 

OS : XP PRO

VB.net Beta 2

Posted

As PlausiblyDamp says it would be hard to tell you the exact problem without seeing the code, however here is an example of code that should do the job

 

Dim myAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()

Dim myStream As System.IO.Stream = myAssembly.GetManifestResourceStream("projectname.image.png")

Dim image As New Bitmap(myStream)

BackgroundImage = image

 

After adding the image to the project you must ensure that its property 'Build Action' to 'Embedded Resource'.

 

On a side note if the problem is that only part of the image is drawing and parts of whatever is behind the form, this is due to the transparency in the png. The png will need editing to prevent that from happening.

Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...