Image.Width Property
.NET Framework (current version)
Gets the width, in pixels, of this Image.
Assembly: System.Drawing (in System.Drawing.dll)
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.
.NET Framework
Available since 1.1
Available since 1.1
Show: