Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image display with visor

 
joan wo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
joan wo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic