picture background no visible

Pascal_Temmar

Newcomer
Joined
Oct 20, 2005
Messages
3
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
 
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.
 
Back
Top