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

How to update database records even if the image is not changed

I am using localDB as my database. I have an employee table, and the employee images are stored in another table This is my stored procedure for create and update: IF NOT EXISTS (SELECT * FROM dbo.Employee …
paraJdox1
  • 805
  • 9
  • 23
0
votes
0 answers

C# Api image to picturebox from url. Exception thrown

I am trying to create a little application and display images of cats from thecatapi.com. I call CATS() on a timer every 10 seconds. The code runs fine for 3-5 images then i get "System.ArgumentException: 'parameter is not valid.'" Ive tried to use…
Toby Hogg
  • 61
  • 1
  • 3
0
votes
1 answer

Retrieve [binary data] from postgresql to pictureBox

I need some help retrieving image [binary data] stored in a posgresql database column and displaying it in the pictureBox in C#. I inserted it using MemoryStream. Thanks!
0
votes
0 answers

C# How to change a picture in a picturebox based off an array value?

I'm creating a to-do list in C# Win Forms. I want to use my own checkboxes since you can't change the size of the checkboxes in visual studio. I'm using two pictures to be placed in a picture box, one empty check box and one checkbox with an X in…
RAZ
  • 11
  • 1
0
votes
3 answers

How to make label transparent without any flickering at load time

I have a panel and on that I've a picturebox. There are around 20 labels that I've to show in the panel. I want the background of Label to be transparent ie the image in picturebox is shown and the label displays only the text. Now since labels do…
Arcturus
  • 437
  • 1
  • 8
  • 19
0
votes
1 answer

PictureBox scrolling past edges of form erases contents

I am trying to create a simple winform application in VB. I have a form, a picturebox with a background image and a button. When I press the button, I want the picturebox to move left across the form until it disappears off the left side. Then I…
0
votes
1 answer

Creating numerous PictureBoxes by code - only one is visible

I am trying to draw lots of instances of an image using the following code: PictureBox[] sprites = new PictureBox[100]; private void Game_Load(object sender, EventArgs e) { PictureBox mainSprite = new PictureBox(); Bitmap img = new…
AquaGeneral
  • 155
  • 1
  • 19
0
votes
1 answer

Problem with the scrolling!

I have implemented a picturebox in my in my form.I even implemented the scrollbars to make the image fit in it.so now the problem is when i try to scroll the button down,it scrolls down and immediately when i leave the mouse the button scrolls up…
raghu
  • 431
  • 2
  • 11
  • 23
0
votes
1 answer

Program first draws on invisible picturebox then picturebox becomes visible DESPITE Visibility supposed to c ome first then dynamic drawing

A snippet of my code: Dim G As Graphics Dim BBG As Graphics Dim BB As Bitmap Dim R As Rectangle .................................................................. picMainScreen.Visible = True G =…
Darp mosh
  • 1
  • 3
0
votes
0 answers

Better performance to store images for a dynamic grid on a .Net windows form?

We have thousands of products and the product information is stored on the database. The images for the products are stored on a network hard drive. Pulling the images, sizing and displaying them on a grid with product information for a quote that…
0
votes
1 answer

C# Main Form BackColor moves in front of image

first of all, I'm new to C# Forms (and also new to StackOverflow). I want to have a small launcher window. I disabled the title bar, so the Main Form is supposed to just be there and hold the UI elements. I added a slightly smaller PictureBox that I…
alex
  • 21
  • 1
0
votes
0 answers

How can I tumble a picturebox in c# form

I'm trying to write a code that tumbles a picturebox when pressed Space key. If we hold the key, the picturebox will enter to a loop like this What should I use?
Demir
  • 13
  • 5
0
votes
0 answers

Move down pictureBoxes continously as the new pictures are coming from behind on a panel

I am trying to write a game on Visual Studio with C#. The aim is to click on the right picture(the one with nemo fish) as they are falling. Until now i have managed to add images from file randomly to Pictureboxes. As time runs, the images are…
0
votes
0 answers

How to turn off visibility of PictureBox which spawns on runtime

I have been making game, where you get task to point every red/blue/green/yellow (random string color) object (PictureBoxes) which are being spawned at a start of a programme. I wanted to give PictureBoxes on click events to add or substract point…
0
votes
2 answers

C# Form's background image as pictureBox parent?

I have a picturebox with some transparency. I found out I can use picturebox.Parent to set the parent image, but it only works when Parent is another picturebox. But what if i want form's background image to be picturebox's parent? …
user562854