Questions tagged [picturebox]

The PictureBox is a control in the Windows Forms system that provides a way to display an image. It can handle many different image formats.

Summary

The PictureBox control provides a way to display images in a window constructed using the Windows Forms GUI framework. Like all other built-in controls, it inherits from System.Windows.Forms.Control and resides in the System.Windows.Forms namespace.

Important properties

In addition to all of the regular Control properties it inherits, the PictureBox also has a couple additional properties for its intended use.

Image

This property allows you to get or set an Image to be displayed in the PictureBox. Any image format supported by GDI+ can be used for this property. See the "Types of Bitmaps" article on MSDN for a list of supported formats.

SizeMode

This property determines how to display the Image within the PictureBox. It accepts a PictureBoxSizeMode value, which says whether the image should be centered, stretched, etc. (To change the size of the PictureBox control itself, use the ClientSize property.)

Links

2606 questions
0
votes
0 answers

Picture from mysql to PictureBox

I'm trying to show image from mysql to PictureBox, and I set it to show on a form load. But when my form loads, picture doesn't appear, and the code shows no errors. Here's the code: Private Sub frmStudentskiPanel_Load(sender As Object, e As…
user8768177
0
votes
1 answer

Matching cards by using .tag

In this game I am creating, I have a set of "cards" as pictureboxes set to a random lot of images. When the game starts, the images in the pictureboxes are hidden and the user has to guess which image was in each card. I am having trouble with…
robot14423
  • 33
  • 6
0
votes
2 answers

Displaying images from a picturebox list

I am trying to display a line of pictures in my program. But I am having a problem, where it is only showing the first image in the imagelist and only showing one image-box. Private Cards As New List(Of PictureBox) Private Sub SetupCards() …
user8960747
0
votes
1 answer

Displaying an image that is stored in the solution c#

I want to display an image in a picture box which I have saved in my solution folder. Is there an easy way for this to be done? I have seen examples of loading from resources using streams etc. But that seems far too much code for what I'm trying…
benjiiiii
  • 478
  • 10
  • 33
0
votes
1 answer

efficiently updating an image? (visual c#)

Im writing a program that requires a lot of updates to be made to a 1400 x 900 pixel image (approx every second or so). In my current build i have used a lockbits function which recalls data from an array (which i have used to store data about each…
0
votes
1 answer

Writing dynamic label to picturebox image only drawing the last modified label

Okay, to start off. I'm trying to make dynamic editable, addable, and removeable text onto a picturebox. I got that working. When saving an image from a picturebox, it doesn't save the labels. I now got it to draw the labels as a string using…
Disloyal g
  • 20
  • 8
0
votes
2 answers

Loaded pictureBox.ImageLocation is null

I'm trying to do something when I click image displayed inside pictureBox1. pictureBox is loaded with this code: string imgpath = @"img\256.png"; pictureBox48.Image = Image.FromFile(imgpath); Then control is released to me so I can see that the…
Matthew
  • 37
  • 8
0
votes
0 answers

Loading picture files to a picture box according to an order?

I'm making a quiz and I wanna make it so everytime i click the Submit button it loads the next questions' respective picture from a file directory on my pc. So first of all the questions are sorted randomly: 7 3 5 8 4... and stored into an array…
João
  • 1
0
votes
1 answer

Best way to use transparent controls as invisible triggers

Once I developed a vb6 code to use transparent controls (Don't remember if I used Buttons or PictrureBoxes) with coordinates as invisible tags & invisible labels to show the names of eachone at groupal photos like Facebook does. Now I'm trying to…
arc95
  • 97
  • 1
  • 8
0
votes
1 answer

Huge picturebox (16000x16000)

Sometimes, my users will use a 16000x16000 picturebox (which is located in a Panel, for autoscroll). The picturebox is used like a tiles map. On it, I draw tiles for making maps (yes, it is a map editor)... But the mere idea of being able to create…
Saturn
  • 17,888
  • 49
  • 145
  • 271
0
votes
1 answer

C# Panel or picturebox for drawing

Im looking to draw a map of dots(coordinates), i want to be able to select these dots later on by clicking on them. Is it better to use a picturebox for this or should i use a panel? EDIT Im drawing the dots from an array of values
FancyLord
  • 88
  • 13
0
votes
1 answer

I want to delete process memory when insert an image into db c#

I have this below code to put an image into picturebox: OpenFileDialog f = new OpenFileDialog(); f.Filter = "JPG(*JPG)|*.jpg"; if (f.ShowDialog() == DialogResult.OK) { pictureBox4.Image =…
0
votes
0 answers

How to display Image from dataGridView by Selected the Row and show the image to pictureBox in C# WindowsForm

How to display Image from dataGridView by Selected the Row and show the image to pictureBox in C# WindowsForm Problem: Cannot retrieve image from datagridView to pictureBox. I Tried the Code Below how to display image on picture box by Select from…
0
votes
1 answer

C#: Handling Events inside a Class

So I'm making a game (specifically Hearthstone) for my Programming II class because I have no better ideas. During my attempt, I realize that creating the Card interface would be much harder than I thought. The Card interface extends the PictureBox…
0
votes
2 answers

make button label change depending on image in picturebox

I'm attempting to make a program in the old Windows Forms with c#. I have managed to make a PictureBox and when the program starts with a randomized couple of images from resources. My problem is that I have 4 buttons I want to change label text on…
Anguiz
  • 7
  • 4