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
4 answers

PictureBox value in C#

I have a question I'm still a newbie in C#. I have 10 pictureBox in my Form and in a method that I've created I need to change the picture but the pictureBox can change like this: void evaluate(int c, int i) { if (contador == 2) { if (aux == i +…
Andres
  • 351
  • 1
  • 4
  • 11
0
votes
1 answer

C# Transparent Panels Refresh Problems

I'm currently working on a project that requires animation on a transparent panel. I have been able to create a transparent panel and draw on it, but when I refresh the panel, where I have drawn with the pen tool is not being redrawn as transparent.…
Alex
  • 5
  • 2
  • 4
0
votes
1 answer

Set Dedault Picture For PictureBox And Save it C#

I want to know how i can get the picture from the project folder and if User not choice any picture i can save it as Default persoanl picture i use this code for create name , path and save ( if i have any pic eveything as fine, if user not choice…
0
votes
1 answer

Looking for dynamically creating and placing a picture box

I'm trying to place red crosses when the user double click on the screen. So I have a picture box that extract X and Y position when we double click on it. (with a GetX() & GetY()) function. I'm trying to dynamically create a picture box and fill it…
0
votes
0 answers

Recover data type in a PictureBOx

I'm working on my first Chess Game. I create a list of PictureBox, and create a class for each piece like this: public class Fou : PictureBox { private ImageLayout ImageLayout; public Fou() { Image =…
0
votes
2 answers

Can you link an array variable with a control?

I am making a program with PictureBox controls. It would be easiest to manage the things I want to do with the PictureBox controls if they were in an array already. This is what I have tried. Sub drawtiles() For x As Integer = 0 To 32 Step 1 …
suryanta
  • 23
  • 2
0
votes
1 answer

C# OnClick .NET framework coordinate limitation

i'm implementing a C# user control (panel) with a picturebox inside. The picturebox is scaled to zoom in and is code painted (basically a vertical ruler that contains some information in correspondence of some of the values), while the panel is used…
0
votes
0 answers

Can't delete shapes from picturebox on Windows Form?

I draw the shapes and visualize them on Windows Form (wiith PictureBox) and add them to List<> , but I can't delete them from picture box with KeyEvent Tried to clear the List and picturebox but didn't work Any suggestions??? This is the class for…
DimityrU
  • 11
  • 5
0
votes
0 answers

Windows Forms - How to move a picture box up when stretching the form

So, I have a situation in windows forms (Visual Studio / C#) that is similar to this : Right now, as you can see, there is no sufficient space beside picturebox number 3 to fit picturebox number 4. However, if the user stretches the form to the…
0
votes
0 answers

picturebox wont show up

did that code and the picture just dont appear no eror no message just open the screen the board there but the picture not public static void Create(Button[,] board) { PictureBox[] BlackpawnsPictureboxes = new PictureBox[8]; …
yuval464
  • 1
  • 4
0
votes
1 answer

showing two line grid on picture box

I am trying to make two reference line which shows the exact center position of the picture box in Visual Basic.net 2019. could you please help with it. I am attaching sample image How it seems like. While saving the image these lines shouldn't…
0
votes
0 answers

How to save an image from picturebox based on picturebox.sizemode?

I would like to know is there any way that I can save an image from picturebox based on picturebox.sizemode or save an image based on picturebox client size? Currently, I noticed even though I set it as pictureboxfilter.sizemode = Normal. It will…
Safwan
  • 85
  • 2
  • 12
0
votes
0 answers

Possible to shoot bullets (PictureBoxes) without using space (like in Space Invaders), for example using a timer?

I'm creating an Arcadium type game (Space Invaders, but you dont press space to shoot) and im having difficulty making my ship shoot bullets on a timer. I managed to make the ship move without any trouble, but I can only find how to shoot using…
0
votes
0 answers

C# Picturebox will not display new image after rotating original image

Issue: After rotating a picturebox image - the image not the pbx - a new image assigned to the pbx will not display or update. The rotated image remains displayed in the pbx. After several "days" of experimenting and searching SO and others, I…
galileo
  • 59
  • 7
0
votes
1 answer

How to post label in center of picture box?

I have a Picturebox contain image (sketchImage mode) and I want to make a transparent Label (contain number) in the center of picturebox So to make the Label transparent i use Parent like this ( in form load event ) : Label7.Parent =…
Dr.andr
  • 7
  • 3