Image.Width Property


Gets the width, in pixels, of this Image.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

member Width : int with get

Property Value

Type: System.Int32

The width, in pixels, of this Image.

The following code example demonstrates how to construct a new Bitmap from a file, using the GetPixel and SetPixel methods to recolor the image. It also uses the PixelFormat, Width, and Height properties.

This example is designed to be used with a Windows Forms that contains a Label ,PictureBox and Button named Label1, PictureBox1 and Button1, respectively. Paste the code into the form and associate the Button1_Click method with the button's Click event.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top