Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Unwanted Flicker with GuiControl.


  • Please log in to reply
7 replies to this topic
Puzzled Greatly
  • Members
  • 612 posts
  • Last active: May 22 2017 11:15 PM
  • Joined: 15 Aug 2009
I have a transparent png overlaid on a red background created using another png. When I hide the top png or replace it using Guicontrol I get a nasty flicker. Is there anyway to stop this happening. Thanks.

Puzzled Greatly
  • Members
  • 612 posts
  • Last active: May 22 2017 11:15 PM
  • Joined: 15 Aug 2009
I've also tried using a second GUi to cover the first while the change takes place. I still get the flicker, however. Rather than the image the whole screen - the gui fills the whole screen. Is this a problem with AHK itself? I don't see these kind of problems if I use Flash but I want to use AHK.

Sjc1000
  • Members
  • 572 posts
  • Last active: Mar 11 2017 11:41 AM
  • Joined: 06 Feb 2012

Hi Puzzled Greatly,

 

There are 2 ways i have learned to deal with this flicker.

 

Method 1:

 

Using a black GUI, so the flicker does not hurt as much :p

Dir 			:= "D:\Pictures"

Gui, Color, Black
Gui, Add, Picture, w500 h500 vPic
Gui, Show

Loop, %Dir%\*.*
{	GuiControl,, Pic, %A_LoopFileFullPath%
	Sleep, 3000
}

Method 2:

 

Disabling the redraw on the picture, while its changing.. This almost completely removes the flicker.

Dir 			:= "D:\Pictures"

Gui, Add, Picture, w500 h500 vPic
Gui, Show

Loop, %Dir%\*.*
{	GuiControl, -Redraw, Pic
	GuiControl,, Pic, %A_LoopFileFullPath%
	GuiControl, +Redraw, Pic
	Sleep, 3000
}

Hope this helps.


Sjc1000 - Insert inspirational quote here!

PLEASE find me on the IRC if you have questions. I'm never on the forum anymore.

 


Puzzled Greatly
  • Members
  • 612 posts
  • Last active: May 22 2017 11:15 PM
  • Joined: 15 Aug 2009
Thanks, I've tried using a black Gui and it does lessen the flicker. I tried GuiControl, -Redraw as you suggested but unfortunately it had no effect at all.

Sjc1000
  • Members
  • 572 posts
  • Last active: Mar 11 2017 11:41 AM
  • Joined: 06 Feb 2012

This is odd. Were you using the code example i gave you or another code? if you were using your own code can you share please?


Sjc1000 - Insert inspirational quote here!

PLEASE find me on the IRC if you have questions. I'm never on the forum anymore.

 


Puzzled Greatly
  • Members
  • 612 posts
  • Last active: May 22 2017 11:15 PM
  • Joined: 15 Aug 2009
I've just tried out the code you supplied and that has no flicker, but it is only using a single png, not one on top of another. If I have a single png then I don't see any flicker with or without using -Redraw. It's only when I use one png over another that I start to get flicker problems.

Sjc1000
  • Members
  • 572 posts
  • Last active: Mar 11 2017 11:41 AM
  • Joined: 06 Feb 2012

Ooh, sorry. I must have skipped over where you mentioned the overlay. Ill mess around with this tomorrow, and see what i can get. 


Sjc1000 - Insert inspirational quote here!

PLEASE find me on the IRC if you have questions. I'm never on the forum anymore.

 


Puzzled Greatly
  • Members
  • 612 posts
  • Last active: May 22 2017 11:15 PM
  • Joined: 15 Aug 2009
Thanks for your help. The best I've come up with is using a Gui under the main one that duplicates the background of the main Gui. Then use Winset, transparent to temporarily hide the main Guii while changing the images.