drawImage

abstract fun drawImage(image: Image, x: Float = 0.0f, y: Float = 0.0f, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1.0f)

Draws an image at its own size with its top-left corner at (x, y). An image still loading draws once it has loaded, as Graphics.drawImage does with its component as the observer.

Parameters

image

the image to draw.

x

horizontal coordinate of the top-left corner.

y

vertical coordinate of the top-left corner.

alpha

the opacity to render with.


abstract fun drawImage(image: Image, x: Float, y: Float, width: Float, height: Float, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1.0f)

Draws an image scaled into the specified rectangle. An image still loading draws once it has loaded, as Graphics.drawImage does with its component as the observer.

Parameters

image

the image to draw.

x

horizontal coordinate of the top-left corner.

y

vertical coordinate of the top-left corner.

width

destination width.

height

destination height.

alpha

the opacity to render with.