Jump to content

GDI+ animation on gui


 Share

Recommended Posts

Hello. I am trying to create preloader animation on gui.

I take one png transparent image, add another etc- supposed to be animation. The problem I am facing: What is the best way of deleting previous image created with gdi plus?

;;;;;          In the main code I create a picture:
Global $preloader = GUICtrlCreatePic("", 50, 180,0,0)

;;;;;          Later on using the function of changing images


func preloader()
if ($load == 1) then $png ="\1.png"
if ($load == 2) then $png ="2.png"
if ($load == 3) then $png ="3.png"
if ($load == 4) then $png ="4.png"
$hImage = _GDIPlus_ImageLoadFromFile($png)
$Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_WinAPI_DeleteObject(GUICtrlSendMsg($preloader, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp))
$load = $load+1
if $load>4 then $load=1
endfunc

 

Link to comment
Share on other sites

I know that your question has already been asked and answered with examples but I cannot find that thread. Anyhow just check out this example how to play an animated transparent GIF:

 

Same technique can be used for your PNG frames.

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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...