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

After adding label to picturebox contols, events don't fire

I'm having a weird behavior with a class I created inheriting from PictureBox. It's a class made to behave like a button (basically what I care about is the mouse enter, mouse leave, mouse down, mouse up events). Everything works perfectly until I…
tom01
  • 76
  • 3
0
votes
0 answers

C# - Moving pictureboxes towards to another picturebox (NPC logic and Vectors)

I'm trying to move pictureboxes(NPCs) automatically towards to main character(pictureBox1), basically I want them to chase pB1. I'm very new to vectors. I couldn't understand the logic very well. First, let me show the codes. int…
0
votes
1 answer

C# Getting pictureboxes from Struct

I want to get the object that created in struct. Showing the codes will explain it better though. private void Obstacle() { obstacle_pos_x = obstacle_random_x.Next(1000); obstacle_pos_y = obstacle_random_y.Next(700); …
0
votes
1 answer

ImageLocation of PictureBox

I am encountering a problem in my code. My code: Imports System.IO Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myPics As New…
nero
0
votes
1 answer

C# Save picturebox as jpeg with Save dialogue box

I have a jpeg shown in a picturebox on my WinForm program, I want to save this to a jpeg file and have the standard 'Save' dialogue box so I can select a location, how can I do this in C#? Thanks Steven
Steve Wood
  • 665
  • 5
  • 11
  • 15
0
votes
1 answer

Moving picture box fast causes flickering C#

I'm trying to move a picture box fast as it is representing a bullet. However, there is a flickering effect and it obscures the image and it is very hard to see the bullet move. I have tried to use double buffering and Invalidating the picture box…
0
votes
0 answers

Vertical line scrolling across a picture

I am making a sound sample player in C# and have a picture of the sample itself loaded into a PictureBox. The user presses the Play button and I would now like a vertical line scrolling across the picture as the sample plays. I would like to use…
0
votes
1 answer

detect how many color shades of a picture inside picture box using vb.net / c#

is there a way to find how many colors present in an image which is loaded to textbox with out clicking the image,by using some other buttons on the outerside.
sansknwoledge
  • 4,209
  • 9
  • 38
  • 61
0
votes
0 answers

Redraw Picturebox at offset and back to simulate as a button effect

I have some images of document and book covers and those are displayed using pictureboxes in a Table layout panel. Image excerpt from winform app I am following this code (From:…
Asif Hussain
  • 67
  • 11
0
votes
1 answer

How to draw small character(x or z) on every click of the mouse in winforms picturebox

I have a C# WindowsForms program where the user clicks on a PictureBox control. I want a small red character every time the user clicks. I also don't want any of the previous character to go away.
0
votes
0 answers

How to update Bitmap on Windows Form using C# or F#?

I want to update a bitmap on the form depending on the keys pressed by the user. I am still new to WinForms, do I need to constantly exit that form and make a new one with the updated bitmap? open System.Drawing open System.Windows.Forms let bitmap…
user7530757
0
votes
0 answers

Picturbox not updating with image?

I'm building a win-forms UI application and here is my issue. I have a picturebox to which I assigne an image (through a command of an in-app button) but it doesn't update the picturebox with the image; it just stays blank. However if I click the…
Bill M.
  • 151
  • 4
  • 15
0
votes
1 answer

VB.NET Combobox and picture box

If someone can help me I will appreciate it. Thanks in advance, I have a combobox with the values databinding inside a database, I want when I move the records next/previous base on what combobox value is a picturebox display a picture I have stored…
Endless
  • 5
  • 5
0
votes
1 answer

Search Image in google

I need to search in google images for a photo and to take the first result and to put in picturebox. The search is by a string that the user is picking. please help. I am Using c#
0
votes
2 answers

Delete all dynamically created PictureBoxes with the same parent in c#

I am writing a windows forms application in C# in which i am dynamically creating TextBoxes and PictureBoxes with a Panel as the parent: PictureBox pb = new PictureBox(); pb.Parent = MainPanel; pb.Name = "pb" + "r" + NumberInRow + "c" +…