Bitmap::SetResolution Method (Single, Single)

 

Sets the resolution for this Bitmap.

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

public:
void SetResolution(
	float xDpi,
	float yDpi
)

Parameters

xDpi
Type: System::Single

The horizontal resolution, in dots per inch, of the Bitmap.

yDpi
Type: System::Single

The vertical resolution, in dots per inch, of the Bitmap.

Exception Condition
Exception

The operation failed.

Use this method to set the desired resolution on a newly created bitmap. Changing the resolution of the image does not change its physical size.

The following example code shows how to use the SetResolution method.

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

.NET Framework
Available since 1.1
Return to top
Show: