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
1 answer

Serializing a PictureBox with JSON

I'm working on a C# Windows Form app project where i need to serialize PictureBox with JSON and save it to a file. For some reason JSON is giving me an error when trying to serialize the PictureBox: "Newtonsoft.Json.JsonSerializationException:…
0
votes
1 answer

Can PictureBox leave a ghost on a Form1 after moving it with a mouse?

I am moving pictureboxes on a Form1 via left-clicking on them and dragging them to another position. (i.e., using mousemove, mousedown, mouseup with e.X and e.Y). I also connect lineshapes from one picturebox to another using drag and drop. When…
user1493382
0
votes
1 answer

C# Update few Picture Boxes at the same time

I have 5 Picture Boxes in my application, and I update them at the same time. I want them to display 5 different Images and my programs code is right, but for some reason the picture boxes show all the same image... Here's the code: private…
Michael
  • 51
  • 1
  • 12
0
votes
1 answer

How to count rotated image coordinates in C#?

I'm making program to draw some lines by using x y coordinates to image in picturebox. The image will be adjustable so can be resized or rotated but I want the drawn lines to follow the image along not staying on the picturebox coordinates. When…
0
votes
2 answers

How do I display a PictureBox on a PictureBox in C#?

I want to display a PictureBox ontop of a Picturebox. I have a "mother" Picturebox and a button next to it. Everytime you click the Button a new PictureBox should be displayed on the "mother". I have created the PictureBox like this: PictureBox…
0
votes
0 answers

how to move and edit drawing object inside picturebox in C#?

I'm currently making simple programs to draw line on picturebox. Click for the first point then drag & release for the 2nd point. Now I want to make that line can be edited rather than making new one. like when click & drag on the edge it will…
0
votes
1 answer

rotated image in a picturebox shows rotated and original form

I'm a begginer using VB.Net framework 4.7.2 Winforms. Im trying to rotate an image of a plane in my application , but it shows the rotated one and the original. left picture is not rotated and the right is rotated at -25° Private Sub…
Jan0660
  • 3
  • 1
  • 2
0
votes
1 answer

Make picture box move across screen during runtime

I am using Windows Forms (.NET Framework) and am trying to make a picture box move a cross a screen. I have tried using timers and this while loop but the image (it's supposed to be a plane) does not appear in the case of the while loop and the use…
Nick Knapp
  • 23
  • 5
0
votes
0 answers

pictureBox location will not change

The pictureBox prints at the same location regardless of where I want it to print. The airplane prints here regardless of where I try to set the location of the pictureBox. private void Form1_MouseClick_1(object sender, MouseEventArgs e) { …
Nick Knapp
  • 23
  • 5
0
votes
2 answers

Set bitmap into CStatic object

I'm trying to add one bitmap into a picture box. This is what I've tried: void DlgError::Define_Image() { // I generate all requiered elements. CBitmap bitmap; // Depending on the type of the message, I define the image to show. …
RookieCoder
  • 105
  • 11
0
votes
0 answers

How to detect graphic edges and only save that portion

I have a PictureBox, which I am using as a "Signature pad". The size is 475,175...If the user signs in a small area, I would like to only save the portion that has a signature mark. I am not sure where to begin. Any help would greatly be…
0
votes
1 answer

How to upload a photo to User Form using PATH and display on other computers?

I built a User Form where there is a post-select configuration that depending on choices shows an image and text results. I uploaded the pictures from a cell where the image PATH is written to a picture box. Image1.Picture = LoadPicture (Sheets…
Raz Aimt
  • 1
  • 1
0
votes
0 answers

Generate picturebox dynamically

I have a product table it contain: Id_product Description Price Image So I create a form , I add a panel , I want to generate picturebox for all product that I have in table product in panel the picturebox.image=image(product table) and i want add…
Farid
  • 3
  • 5
0
votes
0 answers

PictureBox hover over Parameter is not valid issue

I have 3 picture boxes which hold an image from a list string. There is a button which goes through each element in the list string, which in turn updates the 3 picture boxes the picture boxes that hold the 3 images are, picturebox3, 4 and 5. i have…
Vijay Yadav
  • 91
  • 13
0
votes
0 answers

C# Windows Form Application in VS: this.Close(); && Application.Exit(); isn't working

It seems like my script is not being executed. I created my own exit button, pressed on "view code" and added this line: public void leaveButton_Click ( object sender, EventArgs e ) { this.Close(); } I tried the same…
LuaEden X
  • 21
  • 1
  • 2