Pascal_Temmar Posted November 12, 2005 Posted November 12, 2005 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 Quote
Administrators PlausiblyDamp Posted November 12, 2005 Administrators Posted November 12, 2005 Any chance you could post the code you are using? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Cags Posted November 12, 2005 Posted November 12, 2005 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. Quote Anybody looking for a graduate programmer (Midlands, England)?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.