Hello,
I'm trying to create something to measure area and for that I want to be able to retrieve information about cooridnates from the pic.
I'm using Square.java class from your Demo folder.
Could you help me with adding mouse tracking with the MouseOnClickListener ?
I want to be able to retrieve information about position of point that I'm gonna draw on the IplImage ( cause as far as I concern that image is loaded on the CanvasFrame and all the squares are drawn there with the cvPolyLine method).
I was trying to retrieve this information from the canvas but this method returns null constantly....
while(canvas.isVisible()) {
canvas.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
System.out.println(e.getX() + e.getY(););
}
});
}
Is there any way to retrieve this coordinates from IplImage (not from the canvas) and be able draw e.q circle on it with a mouse Click event. I tried to add this event everywhere - but with no success tough...
You'll probably need to add it to the Canvas, not the Frame.
Try to call CanvasFrame.getCanvas().addMouseListener(...).
Thank you! That will work for me :)