CoordinateTransformer class

坐标变换工具类 提供图片坐标系和屏幕坐标系之间的转换功能

Constructors

CoordinateTransformer()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createImageToScreenMatrix({required Size canvasSize, required double rotationAngle, required double scale, required Image image}) Matrix4
计算从图片坐标系到屏幕坐标系的变换矩阵
createScreenToImageMatrix({required Size canvasSize, required double rotationAngle, required double scale, required Image image}) Matrix4
计算从屏幕坐标系到图片坐标系的变换矩阵(逆变换)
getImageDisplayBounds({required Size canvasSize, required double rotationAngle, required double scale, required Image image}) Rect
计算旋转后图片在屏幕上的实际显示边界框
imageToScreen({required Offset imagePoint, required Size canvasSize, required double rotationAngle, required double scale, required Image image}) Offset
将图片坐标转换为屏幕坐标
isPointInsideRotatedImage({required Offset screenPoint, required Size canvasSize, required double rotationAngle, required double scale, required Image image}) bool
检查一个点是否在旋转后的图片内
screenToImage({required Offset screenPoint, required Size canvasSize, required double rotationAngle, required double scale, required Image image}) Offset
将屏幕坐标转换为图片坐标