Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using ImageLocation to set image to picturebox but sometimes at first time it shows unknown image sign but after setting it again it shows the image correctly. How to display the image correctly at the first time?

and

is there an alternate to ImageLocation (i tried to set through PictureBox.Image= place) but didn't work well


I used it like This

picItem.ImageLocation = @"D:/Image1.jpg"
Posted
Updated 20-Jan-14 1:37am
v3
Comments
Karthik_Mahalingam 20-Jan-14 6:21am    
post your code..
agent_kruger 20-Jan-14 6:31am    
sorry sir i cannot post the code but i am going to paste a code snipet

try this.

C#
picItem.Image = Image.FromFile("D:/Image1.jpg");
 
Share this answer
 
Try this:

PictureBox in C#[^]

hope it helps :)
 
Share this answer
 
Try this for picture box:

***
#*#
see this
option 1
option 2
option 3
 
Share this answer
 
v5
you use the wrong slash in path: "D:/Image1.jpg" must be "D:\Image1.jpg"
 
Share this answer
 
Comments
agent_kruger 20-Jan-14 7:37am    
slash doesn't matter sir.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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