Assuming I have an image...is it possible to split it into an array of images where each button has a section of the image? I need to assign coordinates to each button so when a section of the image is pressed I get the coordinates of that piece of the image
Asked
Active
Viewed 24 times
1 Answers
1
You can use BufferedImage then call getSubImage() and break it up that way.
An alternative approach is if the buttons are positioned in the image how you want them already, and you just want to create clickable hotspots, you can listen for mouse events on the image and check the cursor position against an array of coordinates that define the position of each button.

Phaelax z
- 1,814
- 1
- 7
- 19