toyGraphics / com.anysolo.toyGraphics / Graphics / drawImage

drawImage

fun drawImage(x: Int, y: Int, image: Image): Unit

Draws an image.

Recommended file formats: PNG, GIF and JPEG.

fun drawImage(x: Int, y: Int, image: Image, angle: Double, anchorx: Int = 0, anchory: Int = 0): Unit

Draws rotated image.

Draws an image rotated on angle measured in radians. angle=Math.PI will be a half of the full circle. The image rotates coordinates around an anchor point. You can set the anchor point using anchorx and anchory. By default the anchor point is 0,0, meaning the image rotates around its top left corner. Recommended file formats: PNG, GIF and JPEG.