Jump to content

GDI+ flickering problem


Recommended Posts

My application has a loop that refreshes every second.

while true
    _GDIPlus_GraphicsClear($GDI_Buffer)
    _GDIPlus_GraphicsDrawStringEx($GDI_Buffer, $time, $hFont, $tLayout, $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawStringEx($GDI_Buffer, $weather, $dFont, $wLayout, $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
sleep(1000)
wend

It seems from time to time whole window becomes black for a second and then comes back. What did I do wrong?

Thx guys, any suggestions are welcome.. I'm lost here.

Link to comment
Share on other sites

Thx Andreik,

It helps and I'm using it but its not entirely illuminating the flickering...

Turns out GDI+ has a flickering problem no way around it. I think is not designed for frame based applications may be nice GUI at most.

For some reason from time to time Windows clears GDI+ to black until redrawn..? :S

Link to comment
Share on other sites

Turns out GDI+ has a flickering problem no way around it. I think is not designed for frame based applications may be nice GUI at most.

For some reason from time to time Windows clears GDI+ to black until redrawn..? :S

There will be small flicker when redrawing the screen yes, it's because GDI+ is a slow sob when it comes to drawing images.

The window can also turn black when windows invalidates the window rect, this can happen if another windows covers your window. This happens mostly on systems <Vista.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

The window can also turn black when windows invalidates the window rect, this can happen if another windows covers your window. This happens mostly on systems <Vista.

I noticed that with the window!!!

For some apps even when you move you mouse fast over it it seem to work much faster!

I was always wondering why.

Edited by dexto
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...