Table of Contents

Method GetImageWorldBounds

Namespace
PaintDotNet.Direct2D1
Assembly
PaintDotNet.Windows.dll

GetImageWorldBounds(IDeviceImage)

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

RectFloat GetImageWorldBounds(IDeviceImage image)

Parameters

image IDeviceImage

The image whose bounds will be calculated.

Returns

RectFloat

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

Remarks

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