Switching between images displayed on screen, without the annoying white flicker:
You can play around with the margin, pic size and BitBlt sizes to fit your needs.
Code: Select all
#include gdip.ahk
pToken := Gdip_Startup()
hbm := CreateDIBSection(w := 697, h := 550), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gui, 1: Add, Picture, w%w% h%h% +BackgroundTrans hwndpic
Gui, -ToolWindow -Caption -Border
Gui, 1: Show, AutoSize, Example
ddc := GetDC(pic)
Gdip_DrawImage(G, pBitmap := Gdip_CreateBitmapFromFile("gmenu1.png"))
BitBlt(ddc, -7, -15, w, h, hdc, 0, 0)
Gdip_DisposeImage(pBitmap)
Sleep, 1000
Gdip_DrawImage(G, pBitmap := Gdip_CreateBitmapFromFile("gmenu2.png"))
BitBlt(ddc, -7, -15, w, h, hdc, 0, 0)
Gdip_DisposeImage(pBitmap)
Sleep, 1000
ExitApp