dexto Posted July 1, 2009 Share Posted July 1, 2009 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 More sharing options...
Andreik Posted July 2, 2009 Share Posted July 2, 2009 I think you should use double buffer.http://www.autoitscript.com/forum/index.ph...mp;#entry617017 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
dexto Posted July 2, 2009 Author Share Posted July 2, 2009 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 More sharing options...
monoceres Posted July 2, 2009 Share Posted July 2, 2009 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..? :SThere 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 More sharing options...
dexto Posted July 2, 2009 Author Share Posted July 2, 2009 more info:There are methods that can be used to help with flickering (buffering is one of them).Even if you might not use them at least this help explain and understand flickering in GDI.http://stackoverflow.com/questions/197948/...-with-gdi-and-c Link to comment Share on other sites More sharing options...
dexto Posted July 2, 2009 Author Share Posted July 2, 2009 (edited) 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 July 2, 2009 by dexto Link to comment Share on other sites More sharing options...
Yashied Posted July 2, 2009 Share Posted July 2, 2009 Here's another way. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
dexto Posted July 2, 2009 Author Share Posted July 2, 2009 (edited) Its MUCH better now! Thx! The post above has some additional tricks that improve even farther. Edited July 2, 2009 by dexto Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now