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

Print image in PictureBox multipule times

I have a PictureBox control and there is a barcode image in it, I want to be able to add this image multiple times on the same paper. Now, I can only print one image at every time and I want to add maybe 5 or 10 images and put them together and…
Saleh
  • 2,657
  • 12
  • 46
  • 73
0
votes
0 answers

PictureBox reseting his emplacement after using DockStyle.Fill in C# WinForms

To understand what am i talking about, take a look at this video i recorded : https://youtu.be/JhRg1Iw2v2A As you can see the PictureBox goes into the upper left corner when re-showing the pannel below the picture box and setting his size and…
Dièms
  • 5
  • 2
0
votes
2 answers

picturebox.refresh slowly problem

I have written a tetris game in C#.I'm drawing the shapes in picturebox by using below code. graphics g g = pictureBox1.CreateGraphics(); I'm drawing the next step of the shapes by cleaning every second with through timer code. My question…
MaxCoder88
  • 2,374
  • 6
  • 41
  • 59
0
votes
0 answers

Crop top and bottom area of bitmap without stretching the bitmap to picture box. - C#

I have displayed a bitmap on picturebox with sizemode= stretchimage. Now, I have to crop the top and bottom part of the bitmap and have to display it inside the same picturebox. I have done like below. Cropping works fine. But the cropped image is…
user2431727
  • 877
  • 2
  • 15
  • 46
0
votes
0 answers

Printing a sharp barcode using Picturebox

I have a question and i hope somebody can help me. Im using the ZXing.Net plugin to generate a barcode from a number. All is working well and i get a barcode in a picture box. Now i would like to print this barcode but the image is all fuzzy. I've…
Desz
  • 31
  • 7
0
votes
1 answer

c# Does using different child controls in tablelayout panel effect the application speed

I m developing a window optimization application in C#. In that Project I have tablelayout panel. And i added pictureboxes to all cells. In application the user can add columns and rows at run-time. But when the user dynamically add column or row,…
Gokhan
  • 453
  • 4
  • 10
0
votes
0 answers

Can't retrieve image in SharpDevelop from an Access database

I was trying to upload and then see an image, saving it in a MS Access database. I configure the column as "Long text" in Access for saving the bytes image. This is the code that saves my image: MemoryStream ms = new…
0
votes
1 answer

C# - Generic event handler to move pictureboxes created at runtime with mouse

I'm a somewhat beginner to C# using Visual Studio 2019 and currently creating a game and am struggling to find a way to create a generic mousedown/mousemove event handler to move pictureboxes created at runtime through a class constructor with the…
Lotus
  • 3
  • 2
0
votes
0 answers

Picturebox duplicating value

I am working on a little program that starts taking pictures in the moment you click on a button. Also it can be ended earlier clicking another button. The little bug that I am having is that I use a timer to process each time you go throw it since…
Gorben
  • 1
  • 2
0
votes
0 answers

Laggy Image in visual basic

I have an image with 10,000px by 8,000px with a drag method. the problem is that whenever I zoom it in/out or drag it the image flickers. how can I avoid this problem? I tried resizing into smaller one, but the image becomes pixelated and I cant…
jko
  • 133
  • 1
  • 7
  • 14
0
votes
1 answer

How to reference a pictureBox in another Form (Changing a PictureBox from another Form)

I have been building my application with 2 forms, a Home one and a separate form meant at displaying the image. It uses an OpenFileDialog and filters out files for selection. However, how do I actually reference the the Picture Box on the other Form…
0
votes
0 answers

How to make a picturebox move across the panel using buttons

I want to make a program where a picturebox is moving inside of the panel. If a button up is pressed, then it moves only up, if the button down is pressed it moves only down etc. Then there are two buttons true and false, if true is pressed then the…
0
votes
1 answer

how to clear dialog picture control type=frame

I have a dialog picture control of type = frame that I've used as a parent for something else. When the child window is destroyed, the remnants are left in the control. What can I do to either clear the control or cause the demise of the child…
Mike D
  • 2,753
  • 8
  • 44
  • 77
0
votes
1 answer

How to keep a PictureBox within the bounds of the Form

I'm a newbie...please be kind. I am new to coding and starting out by creating a very simple platform game. So far all has gone well but I need to keep my Player within the bounds of the screen and struggling with the code. Player.Left and…
0
votes
1 answer

C#/SQL: Varbinary(max) column to DataGridView to Picturebox

I am absolutely befuddled at the moment. Kind madams, good sirs; please do assist! This is what I am doing: I have a WinForms application connected to a SQL database with a varbinary(max) column for storing pictures. In my parent form (form1), I…
Ole M
  • 317
  • 1
  • 17