Image
data class Image(val id: String = Uuid.random().toString(), val type: String = "Image", val bytes: ByteArray, val intrinsicSize: Size, val points: List<Offset>, val opacity: Float = 1.0f, val zIndex: Int = 0, val rotation: Float = 0.0f, val createdAt: Long = 0, val modifiedAt: Long = 0) : Element
Bitmap element placed on the canvas. bytes is the raw encoded payload (PNG / JPEG / WebP) and the source of truth — the renderer decodes it into an androidx.compose.ui.graphics.ImageBitmap on demand and caches the result keyed by id. Resize / rotate / move / select reuse the standard two-point AABB infrastructure.
Constructors
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Scale points so the bounding box matches newBounds. For two-point shapes this snaps start/end to the new bbox corners (preserving orientation of the original drag direction). For freedraw paths every point is scaled linearly. Rotation unchanged.
Link copied to clipboard
Absolute rotation in degrees.