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

PictureBox not refreshing properly?

I am new to programming pardon me if i am asking a dumb question. I am trying to display real time image that i obtained from a live camera. When i start the program, the picturebox is able to show the object(refer to picture1). When i remove the…
Jarad
  • 41
  • 1
  • 9
0
votes
1 answer

What's the difference between pictureBox.Update() and pictureBox.Refresh()

New to programming and English is not my first language. I am having a hard time trying to understand the difference of Control.Update() and Control.Refresh() the MSDN documentation. I am trying to display real time image to the picturebox, but i…
Jarad
  • 41
  • 1
  • 9
0
votes
0 answers

WPF Setting winforms picturebox image from WPF Window loaded event

I have a WPF splash screen and I want to put an animated gif so I have used a winforms picturebox as explained here (WPF MediaElement is not working for me). Below the code using winforms picturebox:
Willy
  • 9,848
  • 22
  • 141
  • 284
0
votes
1 answer

Dictating Panel and PictureBox Transparency Order

I need a little help understanding transparency order in windows forms. I created a simple form with nothing on it called test. Within the construction of the form, I created a panel and a picture like so: public partial class test : Form { …
Jamin
  • 1,362
  • 8
  • 22
0
votes
1 answer

C# Serial DataReceived Event Invoke Function Not Working Properly

I make a winform program to read data from serial port and display it in textbox. The data will be sent from external device at every 5 sec interval. The first data is "1 followed by "2" and then "3" and repeat the same pattern forever. I will make…
Syscomer
  • 1
  • 1
0
votes
0 answers

how i control 2 picturebox upload photo with one button

private void button6_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp"; fd.ShowDialog(); …
0
votes
1 answer

picture box only displays once

I create the picture box into an object and a container holds all the objects. So, I call the returnIcon method which uses generateIcon if necessary. I have a method in the container to search for the correct object and then returns the icon for…
0
votes
1 answer

Picturebox with Caption in VB.NET

How can I have a picturebox (control) with a caption? I already can add Text over this picturebox, but I want it under the picturebox. But if the location of the text is beyond Picturebox's size, it won't be visible. It would be great if the text…
Amin Darvand
  • 367
  • 2
  • 19
0
votes
1 answer

Displaying a Image previous scanned or retrieved in Picturebox

I just want some help for my project which is RFID attendance system. The RFID tag should be scan to retrieve the information and Image from the database mysql. The first student will scan his RFID tag to display his picture in picturebox1 and when…
Nathan West
  • 165
  • 1
  • 2
  • 10
0
votes
0 answers

How to rotate Optic Form

I am scanning optical forms as jpg or png. Some are leaning to the left and right while scanning. I want to fix the tilts by checking the small coordinate points on the optical form. How can I fix it with windows form (C#)? Thanks indeed.
Coder Tr25
  • 19
  • 5
0
votes
2 answers

Can I use variables to control which PictureBox I am using?

Is there a way that I can use a variable to control which PictureBox I am using in Visual Basic? I.e.: CurrentNumber = 1 PictureBox(CurrentNumber).backcolour = backcolour
user8961582
0
votes
1 answer

Decrease picturebox width from left to right making HP bar for RPG game

i want to create 2 HP bar(left/right) using visual basic, i used hp1.width -=10 to decrease left sided hp like this but when i used it to the right sided it becomes like this i used hp2.Left += 10 hp2.Width -= 10 for the right sided how to make…
0
votes
0 answers

object reference not set to an instance of an object. vb.net picture box saving Error

I have the LMS book adding form in VB.Net. It contains picturebox and text boxes, while I clicked the save button it says the "object reference not set to an instance of an object" error message. On the top I also included the following. Option…
S.Sakthybaalan
  • 499
  • 6
  • 20
0
votes
2 answers

Resizing a resized bitmap image back to original size in WinForms

I have a PNG image of resolution 6000x4000, on which I have to draw upon. So I load the image into a pictureBox with of size 1280x800. After drawing on it, I need to save the PNG image in its original resolution of 6000x4000. So I reload it into a…
SwamJay
  • 27
  • 3
0
votes
0 answers

showing png files in a picturebox

I am new to C# and i am willing to learn it by creating different projects (I am working at one right now). I am trying to make a picture box show different frames of a gif file. I have tried doing this with FrameDimension and SelectActiveFrame but…