Drawing three strings

Report a typo

Write a function that returns a buffered image of size 200x200.

The image should have TYPE_INT_RGB color components, and it should contain the string Hello, images! drawn three times in this exact order:

  • a red one, at position (50, 50)

  • a green one, at position (51, 51)

  • a blue one, at position (52, 52)

The return value of the function should be a BufferedImage with the following contents:

String Hello, images! drawn three times in red, green and blue

Write a program in Kotlin
import java.awt.Color
import java.awt.image.BufferedImage

fun drawStrings(): BufferedImage {
// Add your code here
}
___

Create a free account to access the full topic