O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the PictureBox Control

The PictureBox control is a used to display an image. The PictureBox control has very limited functionality. The control always displays the image in the upper-left corner of the control. The PictureBox control does not provide any way to resize the image so that it can stretch to fill the control.

The PictureBox control exposes the Image property, which represents the current image the control will display. Let's discuss three ways to load an image into the PictureBox control.

An image can be loaded into the PictureBox by loading the image from a file. The following code demonstrates how this is done:

 C# pictureBox1.Image = new Bitmap(@"\Program Files\PictureBoxControl\tinyemulator_content.jpg"); VB pictureBox1.Image ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required