aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Image display with visor 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 » Swing / AWT / SWT
Bookmark "Image display with visor" Watch "Image display with visor" New topic
Author

Image display with visor

joan wo
Greenhorn

Joined: Mar 12, 2007
Posts: 9
Hello,

I have a application that shows a pgm image read it of a file.
When I read the image, I show two frames, one with the original size
(with scrolls) ant another with the same image but with a smaller size.
In this second frame I have to draw a litttle square that represents
the zone of the image diplayed on the frame with the original size.

I display the image, assign it to a label, and run's ok.

To draw a square I think I have to use canvas �?, but when I draw
the square, the label with the image disappear from the frame.

I think I've made something wrong, can somebody help me?
any advice will be welcome.

Thank's for all, and sorry for my English.
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
joan wo
Greenhorn

Joined: Mar 12, 2007
Posts: 9
Hi Craig,

Thank's for you're reply, but I think that how I have my code that's not possible, or at least I don't know how do it.

I have a main class Region.java where I choose a pgm file and then I call to others classes:



In GeneralVisor I create a frame with the pierce of the image to filling oll the available space in the frame.

In GlobalVisor I create a frame with a scaled size of the same image, I read the file again (scaled) and then I show it on this another frame.

I display the image on this method:



Initially I had this here:


and runs ok, but without painting anything over
I've tried to change it by:



when a ImageComponent is the like the class in your comment, but when I run it, appears the next error message:



What's the problem?
I don't know why don't run it ok.

Thank's for all.
 
 
subject: Image display with visor