File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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: 39548
    
  27
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 - updated with new look and Ping home screen widget
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: 39548
    
  27
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: 39548
    
  27
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: 19543
    
  16

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 ?
 
Similar Threads
GUI Problem
Messagebox with Mouseevent
How to combine these two file ?
Get x,y coords outside of windows/screen using mouselook technique
How can i use mouse to click on an image and draw a point after i clicked ?