Re: Catalyst library: pixmap object use. [message #64231] |
Thu, 11 December 2008 20:49 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Giorgio writes:
> This is intended to David, but maybe someone knows better.
> I am using the catalyst library to visualize in real time a
> transformation to some data with some spinners added to control the
> parameters. I use the imgwin program of the library as a template. In
> there, when you creates the selectable draw widget object the erase
> window keyword is specified. This provokes a flickering of the screen
> each time is updated. To disable that I know that we have to use a
> pixmap window. However I did not figure out how to implement and
> coordinate the pixmap object with the selectable draw widget. Then my
> question: Can you give an example or a road map to implement the
> pixmap object.
The DrawWidget object (from which the SelectableDrawWidget is
subclasses) has a container already set up for the purpose
of "buffering" the output from a pixmap. You set the pixmap
with the REFRESHBUFFER keyword. The Refresh method, then,
will copy the contents of the refresh pixmap into the draw
widget window. So, for example, if you had set the pixmap
up as the refresh buffer, you would call the Refresh method
rather than the Draw method to see the contents of the draw
widget. (You would probably add your image object to the pixmap
widget, rather than the draw widget, too, but this depends
on how you are using the refresh buffer. There are no
hard and fast rules for it.)
That said, it is pretty hard to avoid the flicker. In
resizeable widgets, showing images, we *have* to erase
the display somehow or we would get image "debris"
in our windows. However, if your image (or display) takes
up the entire window, you wouldn't have to erase, since
you are guaranteed to write over everything. In this case,
you can turn the erase off. DEVICE, COPY is faster than
ERASE, for sure, but it doesn't completely eliminate
the flicker problem.
> As a side note, the coyote nickname reminds me of a similar animal
> from Argentina, the aguara guazu.
Now there is *another* new thing I have learned today.
I'll have to travel down there and see that. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|