DrawingSurface

smile.infrastructure.DrawingSurface
See theDrawingSurface companion object
class DrawingSurface(val owner: JVMBufferAdapter)

Represents a drawing surface for rendering shapes, images, and text. It encapsulates a BufferAdapter to provide a high-level drawing API.

Value parameters

owner

The BufferAdapter instance that this DrawingSurface operates on.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def clearUsing(color: Color, useSourceColorLiterally: Boolean): Unit

Clears the drawing surface using the specified color.

Clears the drawing surface using the specified color.

Value parameters

color

The Color to clear with.

useSourceColorLiterally

If true, uses the source color without blending.

Attributes

def drawArc(xOffsetToOrigin: Double, yOffsetToOrigin: Double, xPositionOfCenter: Double, yPositionOfCenter: Double, width: Double, height: Double, startAngle: Double, arcAngle: Double, rotationAngleInDegrees: Double, fillStyle: Option[FillStyle], strokeStyle: Option[StrokeStyle]): Unit

Draws an arc on the surface.

Draws an arc on the surface.

Value parameters

arcAngle

Arc angle.

fillStyle

Optional fill style for the arc.

height

Height of the arc.

rotationAngleInDegrees

Rotation angle in degrees.

startAngle

Starting angle.

strokeStyle

Optional stroke style for the arc.

width

Width of the arc.

xOffsetToOrigin

Offset to the origin.

xPositionOfCenter

X position of the center.

yOffsetToOrigin

Offset to the origin.

yPositionOfCenter

Y position of the center.

Attributes

def drawBitmap(bitmap: BufferedImage, x: Double, y: Double, opacity: Int): Boolean

Draws a bitmap image with specified position and opacity.

Draws a bitmap image with specified position and opacity.

Value parameters

bitmap

The BufferedImage to draw.

opacity

The opacity for the image.

x

The x position in pixels.

y

The y position in pixels.

Attributes

Returns

A boolean indicating success.

def drawPoint(xOffsetToOrigin: Double, yOffsetToOrigin: Double, x: Double, y: Double, color: Color): Unit

Draws a point on the surface.

Draws a point on the surface.

Value parameters

color

Color of the point.

x

X position of the point.

xOffsetToOrigin

Offset to the origin.

y

Y position of the point.

yOffsetToOrigin

Offset to the origin.

Attributes

def drawPolygon(xOffsetToOrigin: Double, yOffsetToOrigin: Double, xPosition: Double, yPosition: Double, xCoordinates: Seq[Double], yCoordinates: Seq[Double], numberOfCoordinatesToDraw: Int, fillStyle: Option[FillStyle], strokeStyle: Option[StrokeStyle]): Unit

Draws a polygon on the surface.

Draws a polygon on the surface.

Value parameters

fillStyle

Optional fill style for the polygon.

numberOfCoordinatesToDraw

Number of coordinates to draw.

strokeStyle

Optional stroke style for the polygon.

xCoordinates

X coordinates of the polygon points.

xOffsetToOrigin

Offset to the origin.

xPosition

X position.

yCoordinates

Y coordinates of the polygon points.

yOffsetToOrigin

Offset to the origin.

yPosition

Y position.

Attributes

def drawText(xOffsetToOrigin: Double, yOffsetToOrigin: Double, isScaled: Boolean, width: Double, height: Double, x: Double, y: Double, text: String, typeface: String, size: Double, fillStyle: Option[FillStyle], strokeStyle: Option[StrokeStyle]): Unit

Draws text on the drawing surface, optionally scaling to fit within specified dimensions.

Draws text on the drawing surface, optionally scaling to fit within specified dimensions.

Value parameters

fillStyle

An optional fill style for the text.

font

The font used to draw the text.

height

The height within which the text should fit. Used only if isScaled is true.

isScaled

Indicates whether the text should be scaled to fit within the specified width and height.

strokeStyle

An optional stroke style for the text.

text

The text content to be drawn.

width

The width within which the text should fit. Used only if isScaled is true.

x

The x-coordinate of the center point for the text's bounding box.

xOffsetToOrigin

The horizontal offset from the origin to the point where the text drawing begins.

y

The y-coordinate of the center point for the text's bounding box.

yOffsetToOrigin

The vertical offset from the origin to the point where the text drawing begins.

Attributes

Concrete fields