[gui-test] remove cursor icon

This commit is contained in:
Vladislav Shishov
2018-08-29 15:59:59 +03:00
parent 49cc35c1bb
commit 6e653b4e4c
2 changed files with 5 additions and 8 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

@@ -11,7 +11,6 @@ import javax.imageio.ImageWriteParam
import javax.imageio.ImageWriter
class ScreenshotTaker(private val robot: Robot = Robot()) {
private val cursorImg: BufferedImage = loadCursor()
fun safeTakeScreenshotAndSave(file: File,
captureArea: Rectangle = FULL_SCREEN,
@@ -51,16 +50,14 @@ class ScreenshotTaker(private val robot: Robot = Robot()) {
}
private fun drawCursor(image: BufferedImage, cursorLocation: Point): BufferedImage {
image.graphics.drawImage(cursorImg,
cursorLocation.x - cursorImg.width / 2,
cursorLocation.y - cursorImg.height / 2,
null)
val graphics: Graphics = image.graphics
graphics.color = Color.RED
graphics.fillRect(cursorLocation.x - 10, cursorLocation.y, 20, 1)
graphics.fillRect(cursorLocation.x, cursorLocation.y - 10, 1, 20)
graphics.dispose()
return image
}
private fun loadCursor(): BufferedImage =
this::class.java.getResourceAsStream("/images/cursor.png").use { inputStream -> return ImageIO.read(inputStream) }
enum class ImageFormat(val formatName: String) {
PNG("png"),
JPG("jpg")