Skip to main content

[JAVA2D] graphical annotation

1 reply [Last post]
Anonymous

I am writing a program in which I need to mark x's across a jpeg image on certain spots. I am able to display and manipulate the jpeg image at this point but I need some help figuring out how I can annotate the image by clicking on it. I am not a very advanced java programmer, especially when it comes to images, so a more detailed explanation would be appreciated. Thank you.

*****************************************************************************

David Braun-Friedman

Programador de Telecomunicaciones

Departamento de Electr�nica y Comunicaciones

Email (CEIT): dbraun-friedman@ceit.es

Email (Fuera): dbra5506@postoffice.uri.edu

Tlfno: 943 212 800 Extensi�n: 289

M�vil: 628527739

Centro de Estudios e Investigaciones T�cnicas C.E.I.T.

Paseo Manuel de Lardizabal, 15
20018 San Sebastian

*****************************************************************************

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]
[image001.jpg]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Rosenstrauch, David

Not exactly a Java2D-specific question, but ...

You want to create your own custom component which will do custom painting. See this section of the Java tutorial for details on how to do that.

http://java.sun.com/docs/books/tutorial/uiswing/14painting/practice.html

Once you've set up your custom component, what you'll want to do is implement the paint component method to first paint the jpeg, and then paint the X's (over the jpeg). So it'll look something like this:

protected void paintComponent(Graphics g) {
paintImage(g);
paintAnnotations(g);
}

You'll, of course, have to write the paintImage and paintAnnotations methods to do what you need.

If you have any more questions about this, feel free to write back. Off-list is probably better, as this isn't really a Java2D topic.

HTH,

DR

-----Original Message-----
From: Braun-Friedman, David [mailto:dbraun-friedman@CEIT.ES]
Sent: Wednesday, March 24, 2004 5:22 AM
To: JAVA2D-INTEREST@JAVA.SUN.COM
Subject: [JAVA2D] graphical annotation

I am writing a program in which I need to mark x's across a jpeg image on certain spots. I am able to display and manipulate the jpeg image at this point but I need some help figuring out how I can annotate the image by clicking on it. I am not a very advanced java programmer, especially when it comes to images, so a more detailed explanation would be appreciated. Thank you.

*****************************************************************************

David Braun-Friedman

Programador de Telecomunicaciones

Departamento de Electr�nica y Comunicaciones

Email (CEIT): dbraun-friedman@ceit.es

Email (Fuera): dbra5506@postoffice.uri.edu

Tlfno: 943 212 800 Extensi�n: 289

M�vil: 628527739

Centro de Estudios e Investigaciones T�cnicas C.E.I.T.

Paseo Manuel de Lardizabal, 15
20018 San Sebastian

*****************************************************************************

=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".

==============================================================================
This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]
[image001.jpg]