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

How Can I compare (pictureBox1.Image with Properties.Resources.bug1)?

How I Can tell if that image(pictureBox1.Image) is the same as image from Properties.Resources.bug1 ??? I read that i cant do it in that form : if (pictureBox1.Image == Properties.Resources.bug1) { MessageBox.Show("here"); } I found this…
0
votes
0 answers

PictureBox in Windows Forms - How to open an image by clicking on it to see it in full resolution

How created a simple slideshow with a PictureBox element. Now I would like to open an image by clicking on it to see it in full resolution - with the default app which is associated with .jpg files (e.g. Microsoft Photos). I think a click event on…
Paul Smith
  • 499
  • 2
  • 6
  • 17
0
votes
1 answer

How to Make PicBox to form?

I want to create a program that will create the picturebox to the number that the user enters. I use the following code. int i,j,X = 395, Y = 7, S = 200 / int.Parse(textBox2.Text), C = int.Parse(textBox2.Text),CCC = 0; PPP = new…
0
votes
1 answer

Error when saving image that was retrieved from DB

Here is the situation: I could Save() an Employee entry with a picture from PixPictureBox to the database. If I edit the employee entry and change the picture from the PixPictureBox with a new one, the Update() goes fine. This is where the error…
Pamingkas Sevada
  • 432
  • 9
  • 21
0
votes
1 answer

How to save drawing Graphics to bitmap?

I want to save changes which i made with Graphics to Bitmap file. I have image from camera in pictureBox, and when i have mouse click, i add grid and point to image (in front of image, as i understand), after this i want to save drawing Graphics…
istimbi
  • 41
  • 1
  • 8
0
votes
0 answers

C# WPF - MainFormPaint-Generated Image Layering Over Pre-Created PictureBox Image

I have quite literally scoured the INTERNET'S DEPTHS to try to find a solution to this problem. So here's the current scenario: I have a System.Windows.Forms.PictureBox that contains my main character named Character created and placed in my form.…
0
votes
1 answer

C# - Intersecting Object With Code-Generated Image

I'm trying to build a simple RPG using the C# Windows Forms (as I had recently stumbled upon a fun tutorial demonstrating this ability. I have two items: A 'Character' object that has been placed IN game: In-game character--GUI I also have a…
0
votes
2 answers

How do I create as many instances of an object as i want when a button is press c# winforms

In my code, every time button1 is pressed an instance of a picturebox called NOT is spawned in a panel. When the image is clicked and held on it can be dragged around. My question is every time button1 is pressed I want another pictureBox of the…
user8495277
0
votes
1 answer

Clicking on PictureBoxes with Large Images

I have a winform application that uses a picturebox. In this, the user can click on the picture box and depending on the position of the click do something. It works alright with small images. For reference the code for the clicking is like…
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
0
votes
2 answers

C# - Reordering controls by z-index in Panel

I have a Panel with a PictureBox with Dock = DockStyle.Fill. I need to dynamically add controls to the Panel, but they must stay above the PictureBox. This is easy within the Designer, but when I do this programmatically, neither SetChildIndex(),…
Technical
  • 145
  • 1
  • 11
0
votes
0 answers

How to set a extracted gif image to a picturebox in C#?

I have been trying to teach myself C#and in order to teach myself I have been developing a simple game that has two superheroes attack one another using gifs as the animation for the actions. I have been trying to figure out a work around to have…
TurtleMan
  • 175
  • 2
  • 15
0
votes
1 answer

PictureBox Runtime Image

To see the problems, please follow these steps (I am coding in C#): Put a picturebox on a form named picturebox1 Resize it to small rectangle (say 75,75) Add a picture to resources (named say pic) larger than that rectangle (say 500,500) Now we…
0
votes
0 answers

Rotating a PictureBox is cropping the Image

I have problem that image is getting cropped when I execute a function there are images which rotation do and my code: I copied this code from StackOverflow and searched for this quite a long time, so some help would be good I don't know why is…
0
votes
1 answer

Error in removing a dynamically created PictureBox

I am creating a card game program using C# and suddenly this thing happened when i want to remove every single PictureBox representing cards in hand Visual Studio doesn't read all of the PictureBox in the control whenever I add…
0
votes
1 answer

Change multiple images in list with one button

New to programming. I'm working on a Windows Form Application for the Petals Around the Rose game for school, and although our instructor has shown us how to change individual pictureboxes upon clicking then, I want to make a button that can change…
Kim
  • 1