Click here to Skip to main content
15,914,368 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello
Usually i add my picture(s) / image(s) into my resources folder in vb..
so it was easier to load the picture

but this time i try to load it from harddisc

can anyone please correct my code
cause it can't be load

thank you

What I have tried:

Panel1.BackgroundImage = Image.FromFile("TransparentBackground")
Posted
Updated 21-May-16 20:22pm

1 solution

try this

VB.NET
Dim filePath As String
       filePath = "D:/img/image1.png" ' your image path 
       Me.Panel1.BackgroundImage = System.Drawing.Image.FromFile(filePath)
 
Share this answer
 
v2
Comments
Karthik_Mahalingam 22-May-16 2:34am    
add this

Me.Panel1.BackgroundImageLayout = ImageLayout.Stretch (or) ImageLayout.Zoom
newbie1992 22-May-16 2:31am    
thanks dude... u help me a lot in this.. :D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900