Win a copy of Terraform in Action this week in the Cloud forum!

motress zlting

Ranch Hand
+ Follow
since Jan 10, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by motress zlting

Rob Camick wrote:Custom Painting Approaches shows a couple of different ways. It draws a Rectangle but you can change it to paint a dot. It draws on a JPanel but you can change it to draw on a JLabel with an ImageIcon.



But, for first time i clicked on image, it get coordinate and draw a red dot, for the second times after i clicked, the first dot should remain at there...
I don't don know where should i place those coding......
After i moved my mouse, that dot dissapear....
Help me take a look at my coding....Thanks...

11 years ago

Michael Dunn wrote:in your mousePressed/Clicked code:
you update some variables with the coordinates from the mouseEvent
call repaint()

in paintComponent:
draw the red dot using the info from the (above) variables

> I also need to save and show the coordinate where i clicked.
save where? in a file - you should be able to do that
show where? a JLabel? - just update the label's text with the coords (can be done from mousePressed/Clicked)



I still cannot draw a red dot on image after i clicked .... Can tell me where i supposed to add the coding and what coding suppose to add ?
11 years ago
The bottom is my coordinate text file, how can i split them and store using variables x1=194,y1=272 ,x2=318,y2=270 and so on.....

(194,272)
(318,270)
(321,349)
(144,206)
(411,339)
(209,384)
11 years ago
How can i save each coordinate everytime i clicked ?
11 years ago
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 ?
11 years ago

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.

11 years ago

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...
11 years ago

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....
11 years ago
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.




11 years ago
How can i use mouse to click on an image and draw a point(example a red dot) after i clicked ?
I also need to save and show the coordinate where i clicked.
11 years ago

salvin francis wrote:As suggested in the other posts by me, have you looked at the java2d api ?

You can use Canvas/JFrame/Frame to draw the points. though Frame is a part of awt and you are better off with JFrame/Canvas for your requirement.
Please do go through basic code for java2d/awt/swing before trying out complex examples.



i have go through it, but i cannot find any info that can let me draw something on an image.....T.T Urgent ...
11 years ago
Can anyone tell me how to draw something(example: circle,lines ) on an image ?

1.Browse an image in local laptop,
2.Display it,
3.Draw something on that image.....

what should i use so that i can draw on image ?
Canvas ? JFrame ? Frame ?
11 years ago

David Newton wrote:If you only have one data point, you're not going to be drawing any lines.



Then 3 data will do ?
11 years ago

David Newton wrote:You're going to have to be more specific about the actual problem you're having.

So far it looks like you don't know how to draw a smooth line given a limited set of data points. There are an arbitrary number of ways to do that--which works best for you can only be decided by you. If this is the problem, search the web for various line-drawing algorithms and pick which one you think works best.



Let say i just want to draw the first line,
how can i set a point (access point) on an image ?
if i have only one data which is at distance=12m, signal strength=-68dbm, how am i going to plot for the first line ?
11 years ago
Does anyone can help me combine these two file ?
I have no idea how to do it.....i have tried many times ...
I just want coordinate show when mouse move over image ....

I have one file is browse image (image browser) and display it, another is coordinate (pos) .....



11 years ago