Multi GUI Image Refresh?

Get help with using AutoHotkey and its commands and hotkeys
Olek1
Posts: 1
Joined: 19 Feb 2018, 19:44

Multi GUI Image Refresh?

19 Feb 2018, 22:01

I am trying to find out how to refresh a gui that uses a single updating image source. I am trying to display an updating image to an area of my screen. The image file has the same name and path but is overwritten about every 10-30ms. I got a working result with splash image as it would constantly refresh, but I could not display more than one splash image at once so I would get a flashy/stuttering image output. With the current code I have 2 guis that are in the same position but are alternately activated every 100ms when I press the "alt" key. I was hoping to get a "moving image" from the 2 guis because the image will be changing, but instead it displays an old image it was initialized with. I'm wondering if there is something that I can use to get the same effect as a moving image from 1 updating image source that is smooth and not flashy like with Splash image. I can technically save the image output as a different file each time, but then I worry about synchronization and disk space.
Code Below

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus

BoBo
Posts: 2515
Joined: 13 May 2014, 17:15

Re: Multi GUI Image Refresh?

20 Feb 2018, 08:14

Code: [Select all] [Download] GeSHi © Codebox Plus

SetTimer, iRefresh, % 1000 * 0.5   ; check ever 500ms
Return

iRefresh:
GuiControl,, Image, C:\Users\user1\Desktop\Buff.jpg ; for the Gui Picture control a variable parameter has to be set accordingly ("vImage")!
Return
Not tested.
User avatar
noname
Posts: 507
Joined: 19 Nov 2013, 09:15

Re: Multi GUI Image Refresh?

20 Feb 2018, 12:35

If you want to fast update images without flickering you will need to draw direct on the device context .

code from Skan : https://autohotkey.com/board/topic/7344 ... e-flicker/

example without resizing the original image ( i would use Tic's Gdip library if resizing was needed)

Code: [Select all] [Expand] [Download] (demo.ahk)GeSHi © Codebox Plus

BoBo
Posts: 2515
Joined: 13 May 2014, 17:15

Re: Multi GUI Image Refresh?

21 Feb 2018, 06:14

noname wrote:If you want to fast update images without flickering you will need to draw direct on the device context .

code from Skan : https://autohotkey.com/board/topic/7344 ... e-flicker/

example without resizing the original image ( i would use Tic's Gdip library if resizing was needed)
Using your script I wasn't able to load/draw an image successfully within that GUI. Any idea? Filetype?? :shifty:
User avatar
noname
Posts: 507
Joined: 19 Nov 2013, 09:15

Re: Multi GUI Image Refresh?

21 Feb 2018, 07:50

You are absolutely right BoBo it only works with bmp filetypes , by coincidence i used a bmp to test it ......... :oops:

Using gdip you can use other filetypes but it makes a lot more code or you need to include Tic's gdip library.But i think it is worthwhile apart from using layered windows it is the only way i know of having flicker free rapid updates of images in standard GUI.

example with relevant part of Gdip_all library included , hope i did not mess up something else :?

Code: [Select all] [Expand] [Download] (update_image.ahk)GeSHi © Codebox Plus


Return to “Ask For Help”

Who is online

Users browsing this forum: newbieforever and 24 guests