Recent

Author Topic: Need advice with BGRAVirtualScreen  (Read 2473 times)

stab

  • Full Member
  • ***
  • Posts: 187
Need advice with BGRAVirtualScreen
« on: May 12, 2014, 11:51:19 pm »
Hi all,

My system:
  OS :           Windows XP, SP3
  Lazarus:    1.2.2
  FPC:           2.6.4

Would like to be able to show x- and y-coordinates when moving
the cursor over a BGRAVirtualScreen, but the image disappears and
have to be redrawn, which causes flickering.
The same happens when updating panel.Caption.

How can this be avoided? %)

Attached is a testprogram showing the effect.

Regards
stab

circular

  • Hero Member
  • *****
  • Posts: 3508
    • Personal webpage
Re: Need advice with BGRAVirtualScreen
« Reply #1 on: May 13, 2014, 10:41:19 pm »
In order to draw on the virtual screen, you need to use the event OnRedrawBitmap. It will redraw itself and call that event only when needed (when resizing for example). If you want the content of the virtual screen to be recomputed, then call virtualscreen.RedrawBitmap (to redraw immediately) or virtualscreen.DiscardBitmap (to redraw when the application becomes idle).
Conscience is the debugger of the mind

stab

  • Full Member
  • ***
  • Posts: 187
Re: Need advice with BGRAVirtualScreen
« Reply #2 on: May 14, 2014, 11:34:27 am »
Thanks alot, Circular ::)

circular

  • Hero Member
  • *****
  • Posts: 3508
    • Personal webpage
Re: Need advice with BGRAVirtualScreen
« Reply #3 on: May 14, 2014, 09:52:25 pm »
You're welcome.  8-)
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018