1) At first, I tried adding in the picture using the properties window in VS, I just imported the image. And from the Designer, I see this line : [this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));]. When I see inside the resources folder, the image is .jpg? Explanation please.
2) This time, I'm doing it all manually. Say, I wanted to distribute my own picture to the user. My idea is I could just put the picture inside the same folder as the exe, and use the System.Windows.Forms.Application.StartupPath + "zzz.jpg". But how do I reflect this into the code? I tried this :
this.pictureBox1.Location = new System.Drawing.Point(7, 4);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(265, 246);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.ImageLocation = System.Windows.Forms.Application.StartupPath + "zzz.jpg";
And the picture is not loaded onto the PictureBox. I guess I have to use the Image property, but I don't know how should I ask the Image property to load from the path. Help please.
This post has been edited by red_4900: 22 February 2012 - 10:14 AM

New Topic/Question
Reply




MultiQuote







|