PDA

View Full Version : overlay refresh



GregE
March 18, 2015, 02:16:09
I'm trying to implement an overlay callback that draws text and rectangles. The text and/or rectangles may move depending on user interaction, window size, etc. I assumed that the overlay is drawn over a fresh image but the results appear to show only parts of the image are refreshed. This causes remnants of prior overlayed text/lines to stay on the window. Is there a way to force a complete refresh to guarantee no prior overlay pixels remain?

This can be seen in the GraphicOverlay sample application if you change the horizontal position the text each time the overlay callback is called.

I did it with a static int that I incremented. The text moves across the window, then when it starts over, it leaves a portion.

static int iPos = 0;
iPos++;
if (200 == iPos)
iPos = 0;

Then used it in the DrawText call instead of the fixed value...

pBitmap->drawText(RGB(255,255,0), iPos, 100, (LPCTSTR)szText);

Stefan Geissler
March 18, 2015, 11:17:49
Hello Greg

please have a look at OverlayBitmap::fill() in the documentation.

http://www.theimagingsource.com/en_US/support/documentation/icimagingcontrol-class/meth_descOverlayBitmap_fill.htm

Stefan Geissler
March 18, 2015, 11:17:49
Hello Greg

please have a look at OverlayBitmap::fill() in the documentation.

http://www.theimagingsource.com/en_US/support/documentation/icimagingcontrol-class/meth_descOverlayBitmap_fill.htm