Jump to content

random visual glitch when using GUICtrlSetImage


timmy2
 Share

Recommended Posts

I'm displaying a series of BMP images using AutoIt's GUI capabilities.

Here's my initial test code. All it does is test my goal of displaying a picture, then allowing some code to accomplish a brief task, followed by the next picture, etc. The problem I'm having is that sometimes there's a brief visual glitch in the picture when GUICtrlSetImage displays the next picture. This doesn't happen every time but it happens enough to make the result look funky.

Any suggestions about what I can do to prevent the glitch? Could it be the specs of the BMP images I'm creating in Photoshop CS6?  Under BMP Options I'm using 24 Bit depth, no RLE compression -- ie., the defaults. (note that I've tried using jpg's instead of bmp file without improvement)

$form=GUICreate("PowerStrips",900,530,518,272, BitOR($WS_SYSMENU,$WS_POPUP), 0)
$cid=GUICtrlCreatePic(@ScriptDir & "\imagebackground.bmp", 0,0, 900, 530)
GuiCtrlSetState($cid,$GUI_DISABLE)

;The initial "button" I want to show
$PSimage=GUICtrlCreatePic(@ScriptDir & "\image1.bmp", 0,0,900,530)

GUISetState(@SW_SHOW)  ;show 1st image
MsgBox(0,"","test")

GUICtrlSetImage($PSimage, @ScriptDir & "\image2.bmp") ;show 2nd image
MsgBox(0,"","test")

GUICtrlSetImage($PSimage,@ScriptDir & "\image3.bmp")  ;show 3rd image
MsgBox(0,"","test")

GUICtrlSetImage($PSimage,@ScriptDir & "\image4.bmp")  'show 4th image
MsgBox(0,"","test")

Exit
Edited by timmy2
Link to comment
Share on other sites

After trying various alternative scripting approaches I tried my script on another computer. No white flashes, tears, glitches. So I brought it back to my main box and disabled the Intel GPU that was feeding a 3rd monitor. Down to two monitors connected to a single NVidia GPU the visual glitches disappeared.

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

×
×
  • Create New...