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

How do I make a picturebox move and rotate within a groupbox?

I am currently working on a topdown game made in windows forms. In the game, your character rotates after your mouse and you can shoot a shot from your character in the direction of your mouse. To create multiple areas in the game, I chose to use…
jallebuS
  • 1
  • 1
0
votes
0 answers

How do I move a picturebox from a point to my cursor gradually in C#?

I'm currently working on making a game in C# for a school project. What I want to be able to do in the program is to be able to shoot a picturebox out of my character sprite and to get that picturebox to travel toward the cursor gradually. I've…
jallebuS
  • 1
  • 1
0
votes
1 answer

Why aren't my images loading and moving as expected?

I'm working on a project where I can load a fixed set of data into a listbox. Each line of data is tied to an image in a picturebox. When I click on my load button, the data should be loaded into the listbox and each image should be loaded, and…
Amy Chong
  • 3
  • 2
0
votes
2 answers

Screenshot conversion into grayscale doesn't work. What causes this?

I have a Windows Forms application that takes a screenshot of a specific portion of the screen, then displays it in a picture box (pictureBox1). It works when I don't try to convert it, but I want to convert the image to grayscale or black and…
harcipulyka
  • 117
  • 1
  • 6
0
votes
0 answers

How to crop a picture of an object from an image or a video frame?

Using C# I write a Windows Forms program to crop a picture of an object, but the position of the object is different within the picture. How can I fix it? Here is the code and result. I think that problem is in the mouse up function. Can you guys…
HueNguyen
  • 1
  • 2
0
votes
0 answers

Saving the image from a PictureBox

I checked already for "duplicate questions". None of them have an answer to this question except maybe this one and that one is not working entirely in my case. I want to simply save the image of a pictureBox to a file. First I tried if…
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
0
votes
0 answers

Picturebox with transparent background on top of WebBrowser

I'm trying to make a Floating Player for videos, but I came across this problem that the background does not stay transparent on top of the Web Browser, how to solve it?
Sérgio Wilker
  • 162
  • 1
  • 2
  • 18
0
votes
0 answers

C# PictureBox Visible Property causes PictureBox to be null when false

I am new to C# and was trying to write a small memory card game. I have a TableLayouPanel with 16 picture boxes inside, whenever I make the picture boxes invisible (when I setup the game images) my event method shows that my picture boxes are null…
Bill789
  • 27
  • 4
0
votes
1 answer

How can I reuse a piece of code to edit multiple pictureboxes

Im trying to write a piece of code to set the image of the 92 pictureboxes I have in my form. I don´t want to write the same piece of code 92 times, so i was wondering if this can be done faster. My code is: public void drawRoute() { if…
0
votes
0 answers

Add PictureBox over Button

As can be seen in the image, I am trying to create a minesweeper game, whereby a flag is displayed on a square (a button) when the user right-clicks a box. I set the flag PictureBox to a transparent background, and brought it to the front by using…
Luke Xuereb
  • 73
  • 12
0
votes
0 answers

Transparent moving pictureBox

I I'm trying to make a platform game but im having some problems with making the pictureBoxes (objects like platforms etc) blending in to the background. I've tried setting the background as a parent of the pictureBoxes and using the transparent…
Rasmus
  • 1
0
votes
1 answer

Listview selected item to PictureBox

I am new with vb and sql, can someone help me Retrieve image when i click my selected items in listview and view it on PictureBox so that i can update the values. Private Sub lvRegistered_SelectedIndexChanged(sender As Object, e As …
LC.
  • 13
  • 1
  • 6
0
votes
2 answers

dynamically Setting picturebox imagelocation at run time?

Here i want to set the imagelocation like this: pic1.ImageLocation = ""; pic2.ImageLocation = ""; and so on... foreach (ImageResult result in response.Image.Results) { i++; PictureBox thumnailBox = new System.Windows.Forms.PictureBox(); …
jack
  • 3
  • 1
  • 2
0
votes
1 answer

C# How do I move a picturebox that changes images depending on the direction hes facing?

Using visual studio 2015 I use a picture box as a player and have it move up, down, left and right. When the picture box moves it shrinks and then looks like it teleports. That is not what it is supposed to do. How do I properly get the picture box…
no name
  • 23
  • 3
0
votes
0 answers

Why MouseEvent on a picturebox triggers even outside of picturebox (Still within the winform)?

I have a form where I have a Picturebox within it, I Utilizes "MouseUp" & "MouseDown" event to draw. Everytime when mouseup event is detected(after mousedown event), a new form will pop-up. The pop-up form is basically for user to select their…