How to draw a layer with some annotations over a big picture?
Joined: Dec 22, 2009
I am looking for a way to load large image files (10 MB Jpeg files) and then place some annotations over the image file using a transparent layer or something like that.
Basically I have the annotation with a coordinate in the picture which annotations should appear stored in a database, now I want to load the image and then draw those annotations on the picture.
In addition, I will need to make it possible for the users to click on annotations to open new Swing forms.
I will thankful if you let me know whether following things are possible in Java or not:
-Drawing semi-transparent panel over an image in a specific X,Y
-Adding actions like onclick action to those drawing so users can click on annotations to perform some specific actions.
If they are possible, can you please give me some heads-up about which APIs I should look for and whether any tutorial is available for doing such jobs or not.
I searched in Google and most of my findings were talking about loading icons and small images in a JLabel which I believe is not what I need as I am going to load a big file and I am looking for more features and actions.
1) Custom Painting in Swing. In short, you override the paintComponent method, first call super.paintComponent, then draw your annotations over the image. You should use a JLabel; this will take care of the main image itself automatically.