Method SetResolution
SetResolution(float, float)
Sets the horizontal and vertical resolution (DPI) metadata for the image.
public void SetResolution(float horizontalResolution, float verticalResolution)
Parameters
horizontalResolutionfloatThe horizontal resolution in DPI.
verticalResolutionfloatThe vertical resolution in DPI.
Remarks
This operation updates resolution metadata only and does not alter the pixel data.
Exceptions
- ArgumentOutOfRangeException
Thrown when a specified DPI is less than or equal to zero.
- ObjectDisposedException
Thrown if this instance has been disposed.
SetResolution(float)
Sets both horizontal and vertical resolution to the same DPI value.
public void SetResolution(float dpi)
Parameters
dpifloatThe resolution in dots per inch to apply to both axes.
Exceptions
- ArgumentOutOfRangeException
Thrown when
dpiis less than or equal to zero.- ObjectDisposedException
Thrown if this instance has been disposed.