Screen Refresh

J

JSeligstein

I have two versions of the same image. One is a scaled version of the
other. I would like to display the smaller zoomed-out image on the
screen, and where the mouse is, I would like to "fisheye" the small
view. However, instead of a standard ballooning fisheye, I would like
to pull more data from the larger image. I have this routine written
well. However, getting this data to display in a workable fashion to
where there is a decent refresh rate with no flashing seems to be a bit
of a problem. I've seen examples of transforms (without source!) on the
internet that run at very high speeds... so I know this is possible.

If anyone has any infromation on which set of classes and techniques to
use, I would appreciate the help. Currently, I have a thread running to
call repaint( ) every so often, which draws a BufferedImage. However,
this blinks and will still not refresh while a mouse is moving.

Thanks for any help!

(This is a reworded repost with more information, please ignore the old
one. Thanks!)
 
A

Alex Whitney

If you are experiencing flashign when you update your images, it may be
caused by not double buffering the object.

If you are using a canvas to display your graphics, try changing the
buffer strategy (to 2 or maybe 3..play around with it).

Other display objects have ways to double buffer. For example, JPanel
has a constructor to allow double buffering.

If you are only displaying one image, then you don't need to constantly
update the image. Just paint your image/transformation/etc to an Image
object, then repaint the image in your display object's (canvas,
JPanel, whatever) repaint method. This prevents you from updating the
image more than necessary and won't recalculate the image more than
once.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,118
Latest member
LatishaWhy
Top