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 to specify the position of picture box in panel control instead of using foreach?

foreach (PictureBox picture in panel1.Controls) { if (count == 12) { break; } count = count + 1; picture.Enabled = false;//disable clicking card points.Add(picture.Location);//card location in the…
Kyson
  • 11
0
votes
1 answer

How to autoscroll panel or picturebox in MouseMove event in VB:NET

I'm trying to autoscroll panel with an image using mousemove event simulating a dynamic zoom. I found this example Pan/scroll an image in VB.NET and this Scroll panel based on mouse position in VB.NET but I realized that the user have to click on…
Rchrd
  • 35
  • 1
  • 8
0
votes
0 answers

How to create Picturebox in VB.net web application?

I work with vb.net web application and I want to create picture box which I can upload a picture in it. Is it possible to create it?
0
votes
0 answers

How to pass an Image from UserControl1 to another UserControl2 (C#, Windows Forms)

I have 2 UserControls on my Form1. They are stacked on top each other within a panel. In UserControl1 i load the image from a file using the OpenFileDialog. On my Form1 i have also a Toggle Button, where the user can switch between the two…
Mike19
  • 95
  • 6
0
votes
1 answer

Draw, Click and drag a drawn graphics in Picturebox c#

I want to make a WinForm Application in c# that I can draw a graphic, like a rectangle, and after drawing, when I click on the rectangle, it will show 5 boxes, to let me drag it to resize, and when pointing on the middle of the rectangle, it able to…
0
votes
1 answer

C# WinForms | Picturebox white bleeding right & bottom edges

Hello Stackoverflow Community. I currently work on an application which has a cursor region magnifyer feature, for the user to pick a color. However, i've the problem that the Picturebox has white edges on the right and bottom, even though the image…
Taki7o7
  • 197
  • 2
  • 11
0
votes
1 answer

C# Draw on PictureBox with Graphics.DrawLine() not working on Paint event

I have a from with a PictureBox and a button (see image). When user click on "Draw" the programm draws two crosses. I did the same thing for the PictureBox Paint event handler, but if I minimize the form and reopen it nothing is drawn (except Image…
pado
  • 123
  • 1
  • 11
0
votes
1 answer

WebGUI with Blazor / C# .. can blazor realize Windows Forms PictureBox class?

We try to realize a web-based UI using blazor. To make the first steps, we are trying to do the following: Design a basic frontend Create button for connection with a (local) mySQL database Draw heatmap of stored positions…
beinando
  • 477
  • 4
  • 18
0
votes
0 answers

Weird PictureBox/Label problem in C# (Visual Studio 2019)

In C#, using Visual Studio 2019, I have run into a bizarre problem that makes literally no sense. I've been working on a program based on the Who Wants to be a Millionaire game show. For some reason, changing one PictureBox to visible, apparently is…
0
votes
1 answer

MFC CPP A problem with putting picture in picture control on load

I got MFC app and I wanted to upload a picture using those 3 lines: cbitmap_.LoadBitmap(IDB_BITMAP1); picture_control_.SetBitmap((HBITMAP)cbitmap_.Detach()); UpdateData(FALSE); When I did it on the main Dialog it worked. I tried to use it on a…
Danielgard
  • 45
  • 4
0
votes
1 answer

.Net Winforms picture box custom drag is twitchy

I am making an application in which I load a bunch of 256x256px chunks of a map and stitch them together with magick.net to then display them in a picture box. I added a feature for slewing the image (and loading new picture chunks as I do) using…
FalcoGer
  • 2,278
  • 1
  • 12
  • 34
0
votes
1 answer

How to get specific PictureBox from Button Click event?

Here is my code: private void button1_Click(object sender, EventArgs e) { Button btn = sender as Button; PictureBox pic = sender as PictureBox; if (btn != null) { btn.Visible = false; } i++; if(i == 2) { …
0
votes
0 answers

Why picture box return original position after minimize screen?

I have built an application using Windown Form in C#. The picture box original location is A. In this application, I use button to move position of Picture box. When I press the button, this picture box will move to another position (Location B),…
0
votes
1 answer

picturebox path parameter

I want to add a parameter to image path.Otherwise,I'll call those images through a parameter with integer number. For example: hamlekullanici.Image = Image.FromFile(@"images\\"+hamlekullanici+".png"); Username -- > hamle Variable -- >…
MaxCoder88
  • 2,374
  • 6
  • 41
  • 59
0
votes
0 answers

Curve with WinForms PictureBox Not Proportional

I've tried drawing mathematical curves in C# using WindowsForms PictureBox widget, but the result was not proportional to my intentions ( way too dense and weird) : This was supposed to be a sine function, like in this video: A Youtube Tutorial. I…
Jonathan
  • 88
  • 1
  • 8