Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How do I put an image into my picturebox using ImageLocation?
- PictureBox picture = new PictureBox
- {
- Name = "pictureBox",
- Size = new Size(100, 50),
- Location = new Point(14, 17)
- };
- p.Controls.Add(picture);
- picture.ImageLocation = @"..Image1.jpg";
- picture.ImageLocation = @"Image1.jpg";
- PictureBox picture = new PictureBox
- {
- Name = "pictureBox",
- Size = new Size(100, 50),
- Location = new Point(14, 17),
- Image = Image.FromFile(@"c:Imagestest.jpg"),
- SizeMode = PictureBoxSizeMode.CenterImage
- };
- p.Controls.Add(picture);
- PictureBox picture = new PictureBox
- {
- Name = "pictureBox",
- Size = new Size(100, 50),
- Location = new Point(14, 17),
- ImageLocation = @"c:Imagestest.jpg",
- SizeMode = PictureBoxSizeMode.CenterImage
- };
- p.Controls.Add(picture);
- picture.ImageLocation = Path.Combine(System.Windows.Forms.Application.StartupPath, "ResourcesImages1.jpg");
Add Comment
Please, Sign In to add comment