Drawing two lines

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 two lines drawn in this exact order:

  • a red one, starting at position (0, 0) and ending at position (200, 200);

  • a green one, starting at position (200, 0) and ending at position (0, 200).

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

On the black background drew two lines in red and green

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

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

Create a free account to access the full topic