Please see below.
Nic Smith wrote:
Thanks for your input.
You mention two concepts here that I have read about, but not investigated.
I suspect I may need to break into the black box in order to make these
It is not clear to me though how these approaches impact drawing
Currently in the black box the image is created with
PhCreateImage(NULL,…) then a memory context is created with
Depends on why they are using the memory context. If they are trying to
composite the image before you draw it then leave this the way it is.
The offscreen option should still work.
Outside of the black box I request the MC, start it, render the image, then
flush and stop the MC. THEN I damage the widget.
Create an offscreen context using PdCreateOffscreenContext.
Make the Offscreen Context current by using PhDCSetCurrent, saving the
old draw context.
Draw the image in to the offscreen context using PhDrawImage.
Set the old dc to current use PhDCSetCurrent and the previously saved DC.
In the call back for drawing the widget I do the recommended canvas
translations then call PgDrawPhImagemx() passing in the the already rendered
Here, instead of drawing the image every single time, Just do a
PDContextBlit from your offscreen context to the raw widget. A blit is
much faster than drawing the image.
Please note that this will just get you up and running to see if you are
in fact seeing a reduction in screen flicker. You may have to take
additional work to take in to account loss of OFfscreenContext, which
can happen if there is a mode change. Also, if you change the image you
will have to redraw it in to your offscreen context.
Will either of the two techniques you mention improve the performance of
If so, which photon functions should I take a look at ?
“Rodney Dowdall” <> firstname.lastname@example.org> > wrote in message
news:caup8t$fen$> email@example.com> …
Is the image in shared memory? Putting it in shared memry would help if
it’s not already there. Also, can you render it in an offscreen context
and then do a context blit from the offscreen context to the raw widget?
This should reduce the amount of flicker.
Nic Smith wrote:
I am experiencing poor graphics performance in my application, and I am
seeking guidance on the best way to get the best performance for my type
My application has a PtRaw widget into which I draw an image. The widget
damaged at a regualr interval by a timer and needs to be completely
The Raw canvas is 800x400 pixels The image I am drawing is 800x400 and
the Pg_IMAGE_DIRECT_888 attribute set.
It is created by PhCreateImage().
Unfortunately, how the image is populated with data is currently a black
to me, but I have to display its contents on the screen.
My problem is that on an 800Mz laptop with LCD display I see the image
raster fashion from top to bottom of the display, which results in a
On my ultimate target platform (which is slower) the flicker is
To add to the problem, I then need to overlay information or simple
menus on the image.
Before I start to blame the performance of the graphics drivers (which
not common between my two test scenarios) I would be interested in
ideas about the most effective use of the photon libraries for getting
best flicker free graphics performance in such an application.
Any thought would be much appreciated.