aspose file tools*
The moose likes Java in General and the fly likes How can i have the coordinate on a buffered image ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How can i have the coordinate on a buffered image ?" Watch "How can i have the coordinate on a buffered image ?" New topic
Author

How can i have the coordinate on a buffered image ?

motress zlting
Ranch Hand

Joined: Jan 10, 2010
Posts: 55
How can i have the coordinate on a buffered image ?
i have these two coding, one is buffered image and the other is coordinate part.
How can i combine the coordinate part with the buffer image coding ?
The imageBrowser is coordinate part, the imagecapture is buffer image part. Kindly take a look on it.




Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Can you describe in words what you mean by "the coordinate on a buffered image"? What are the inputs, and what are the outputs? The code you posted is very thinly commented, and doesn't make clear what the end result should be.


Ping & DNS - my free Android networking tools app
motress zlting
Ranch Hand

Joined: Jan 10, 2010
Posts: 55
Ulf Dittmer wrote:Can you describe in words what you mean by "the coordinate on a buffered image"? What are the inputs, and what are the outputs? The code you posted is very thinly commented, and doesn't make clear what the end result should be.


In the imagebrowse file, when mouse move over the image, wherever the mouse move on that image, the system will print the current coordinate. But i want to make use of this function to the buffer image....
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
What stops you from adding the same MouseMotionListener to the ImageCapture object?
motress zlting
Ranch Hand

Joined: Jan 10, 2010
Posts: 55
Ulf Dittmer wrote:What stops you from adding the same MouseMotionListener to the ImageCapture object?


i have try to add mouselistener into imagecapture , but cannot work .....sobs...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
but cannot work .....

Why not? How did you do it, and what happened?
motress zlting
Ranch Hand

Joined: Jan 10, 2010
Posts: 55
Ulf Dittmer wrote:
but cannot work .....

Why not? How did you do it, and what happened?


i have combine 2 file, but the label keeps printing the coordinate on that image when mouse moved.
I don't want the label to print coordinate on image, i just want to print it in console.....How can i do this ? Help me take a look.

motress zlting
Ranch Hand

Joined: Jan 10, 2010
Posts: 55
Maybe i need to start with easier part.
I want to start with this simple part.
How can i click on an buffered image and print out the coordinate ?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

You can't click on a BufferedImage, since a BufferedImage is only something in memory. You can catch a click on the component that is painting the image using a MouseListener, then translate the mouse location from relative to the component to relative to the image:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can i have the coordinate on a buffered image ?