Table of Contents

Method GetImageLocalBounds

Namespace
PaintDotNet.Direct2D1
Assembly
PaintDotNet.Windows.dll

GetImageLocalBounds(IDeviceImage)

Gets the bounds of an image without the world transform of the context applied.

RectFloat GetImageLocalBounds(IDeviceImage image)

Parameters

image IDeviceImage

The image whose bounds will be calculated.

Returns

RectFloat

The bounds of the image in device-independent pixels (DIPs) and in local space.

Remarks

The image bounds don't include multiplication by the world transform. They do reflect the current DPI, unit mode, and interpolation mode of the context.
To get the bounds that include the world transform, use GetImageWorldBounds(IDeviceImage).
The returned bounds reflect which pixels would be impacted by calling DrawImage(IDeviceImage, Point2Float?, in RectFloat?, InterpolationMode, CompositeMode) with a target offset of (0,0) and an identity world transform matrix. They do not reflect the current clip rectangle set on the device context or the extent of the context's current target image.