Tag Archives: PictureBox

Tile a PictureBox in C#

If you set a form’s BackgroundImageLayout property Tile, then the control fills itself with copies of its background image. Strangely the PictureBox control does not have a corresponding Tile property. This example shows one way you can tile images on … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , , , , , | Leave a comment

Display thumbnails for image files in a directory in C#

This example shows how to display thumbnails for the images in a directory. It displays a tooltip when the mouse hovers over a picture and it opens the image file in the default application if you double-click on an image. … Continue reading

Posted in controls, graphics, image processing | Tagged , , , , , , , , , , , , | Leave a comment

Make shaped PictureBoxes in C#

This example shows how to use regions to make shaped PictureBoxes. The PNG image format allows you to define transparent pixels. As you might guess, if you draw an image with transparent pixels, those pixels are not drawn and whatever … Continue reading

Posted in algorithms, geometry, graphics, image processing | Tagged , , , , , , , , , , , , , , , , , | 1 Comment

Use a loop to load pictures in C#

When the form loads, the following code loads pictures into the form’s PictureBoxes. private void Form1_Load(object sender, EventArgs e) { string dirname = Path.GetFullPath( Path.Combine(Application.StartupPath, @”..\..\”)); // Make an array holding the PictureBoxes. PictureBox[] pics = { PictureBox1, PictureBox2, PictureBox3, … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , | Leave a comment

Zoom and scroll a picture drawn in C#

This program lets you zoom and scroll a picture drawn by the program. The program contains a Panel with AutoScale set to true. Inside the Panel is a PictureBox with SizeMode set to AutoSize. The PictureBox contains a Bitmap that … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , , , , , | 2 Comments

Drag and drop images in C#

This example shows how to drag and drop images in C#. The example Drag and drop text in C# explains basic drag and drop operations. See that example for the fundamentals. One of the first things you must do before … Continue reading

Posted in Drag and Drop, graphics, image processing, interoperability | Tagged , , , , , , , , , , , , , , | 6 Comments

Use double buffering to prevent flicker in a PictureBox in C#

The example Use double buffering to prevent flicker when drawing in C# shows how to make a form use double-buffering to reduce flicker. Rather than drawing everything on the screen as it is generated, the form draws onto an image … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , , | 1 Comment