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

What's the most efficient way of allowing a user to rapidly cycle 100+ images through a picturebox

Full disclosure: I have no formal training in programming, but have dabbled for many years. I'm making a windows application for use in education/medical imaging. One of the things I would like it to do is to enable the user to scroll through a…
0
votes
1 answer

Clearing previously loaded images in WinForm from resources

Purpose of my WinForm application is to load and display for a short while randomly selected picture from specific folder. I'm doing this using a PictureBox like so (this line gets adjusted by random number generator to generate different number…
Vojmor
  • 1
  • 2
0
votes
0 answers

How to get rid of painted area by _onPaint method in PictureBox VB .net?

I have this problem. I used code bellow (by Erno de Weerd) to make a blue marked area on image located in picture box. Whats my problem now is to process this area afterwards. I need that when I release left mouse button, this rectangle dissapears…
0
votes
2 answers

How to make the PictureBoxes change from visible to unvisible depending on user input?

I am making an Enigma Simulator Application in C#. In addition to that I am trying to make its lightboard, which is basically a keyboard that lights up the letter which is returned by the reflector. Now, my idea was to add 26 pictureboxes with…
lisalisa
  • 3
  • 1
0
votes
0 answers

Is it safe for C# camera frame event to update a pictureBox? I'm getting intermittant error: "System.Drawing.dll .. Parameter is not valid."

Or, should pictureBox only be updated by the UI thread? I assign event callback to my Accord VideoCaptureDevice class, which gets live frames from my USB camera. About 10 frames per second. In the event callback, I update a pictureBox with the…
Doug Null
  • 7,989
  • 15
  • 69
  • 148
0
votes
0 answers

Wpf - How to make picture box full view

I am using picture box in my wpf application. The use of these picture box is to preview the video. So when the user click the full view button, how to make full screen the video(ie, picture box).?
Jinesh
  • 1,480
  • 2
  • 25
  • 52
0
votes
1 answer

Rotate image in c#

I wish the image in picture box could flip when key left is pressed, as the code shown below, but it didn't flip when key left is pressed. Anyone could help ? Thanks a lot! namespace WindowsFormsApp1 { public partial class Form1 : Form { …
J.y
  • 1
  • 1
0
votes
0 answers

How do I show a different picture in my picture box based on the user input in C#?

The user needs to fill in a form at the beginning of the game and I was trying to use their selected gender to generate which icon they will have. However I have tried many solutions to this problem and the picturebox either remains blank when I run…
Buttons
  • 11
  • 3
0
votes
0 answers

Change the Reference Moving Point of an Object Using Click Event

The point I need help is that when I try to do a click event, a different point of a picture box object should be positioned, not the top left corner. Is there a way to change the reference moving point of an object? Example: The point shown as…
drakislow
  • 41
  • 2
  • 9
0
votes
1 answer

Resize PictureBox width and keep aspect ratio

I'm loading the image dynamically to a pre-existing PictureBox person_img that has all default values and is not sized correctly. I'm expecting to be able to do the sizing dynamically so that all images are 1/3 of people_popup_tab width. I've tried…
brienna
  • 1,415
  • 1
  • 18
  • 45
0
votes
0 answers

How to display image in picturebox from datagrid?

I am working with Windows Form Application and I have SQL Database with table members and the columns: id, fname, lname, gender, telephone, created, email and picture (the pictures are saved . I am using bound DataGrid with all the columns except…
moxydoxy
  • 3
  • 2
0
votes
1 answer

C#, Windows Form, redraw pictureBox

I have a problem with C# game. There are a matrix with randomly-placed wolves and raccoons. When user click the "new game" button I need to generate new positions for animals and redraw my canvas (PicureBox). So, I have no problem with generating,…
0
votes
0 answers

How do I drag and drop pictures into specific picture boxes in arrays? (re-asked, deleted original)

I want to be able to drag and drop an image into any picture box in my array, however when I drag and drop my image into a picture box in that array, the picture box drags into all picture boxes in that array. How do I solve this? Here's my…
0
votes
1 answer

Winform PictureBox not transparent when run on XP

I'm trying to make a software that displays various GIFs in PictureBox on transparent form background. Everything's fine so far, but there is one difference when I run the program on different systems. I'm writing it on Win10 64bit laptop with .NET…
Vojmor
  • 1
  • 2
0
votes
1 answer

How could I resolve A generic error occurred in GDI+. in VB.Net?

When image field property in class is set with the image raw format of the same image from my database in picture box, it always throws this exception. In contrast, if the image in the picture box has been updated with one I select from my local PC…
Sophart
  • 67
  • 1
  • 10