EditableImage
Reads, writes, and draws image pixels at runtime.
Behavior
EditableImage reads, writes, and draws image pixels at runtime.
Summary
The generated content identifier used to display this editable image.
The image width and height in pixels.
Fills the image with the supplied color and transparency.
DrawCircle(center: Vector2, radius: number, color: Color3, transparency: number?): ()Draws a circle using pixel coordinates for its center and radius.
Draws a line between pixel coordinates with the supplied color and optional thickness.
DrawRectangle(position: Vector2, size: Vector2, color: Color3, transparency: number?): ()Draws a rectangle at the supplied pixel position and size.
ReadPixels(position: Vector2, size: Vector2): bufferReturns RGBA bytes for the rectangular pixel region.
WritePixels(position: Vector2, size: Vector2, pixels: buffer | { number }): ()Writes a rectangular pixel region.
Properties
ContentId
EditableImage.ContentId: stringThe generated content identifier used to display this editable image.
Size
EditableImage.Size: Vector2The image width and height in pixels.
Methods
Clear
EditableImage:Clear(color: Color3?, transparency: number?): ()Fills the image with the supplied color and transparency.
DrawCircle
Draws a circle using pixel coordinates for its center and radius.
DrawLine
EditableImage:DrawLine(from: Vector2, to: Vector2, color: Color3, transparency: number?, thickness: number?): ()Draws a line between pixel coordinates with the supplied color and optional thickness.
DrawRectangle
EditableImage:DrawRectangle(position: Vector2, size: Vector2, color: Color3, transparency: number?): ()Draws a rectangle at the supplied pixel position and size.
ReadPixels
Returns RGBA bytes for the rectangular pixel region.
WritePixels
Writes a rectangular pixel region. A buffer contains RGBA bytes; a numeric array contains RGBA components from 0 to 1. Position and size must be integer pixel coordinates. The data length must match the region.
Operators
__tostring · __type