Jump to content

How to place Label on top of animated GIF ?


 Share

Recommended Posts

#AutoIt3Wrapper_Res_File_Add=1.gif, rt_rcdata, G2

#include "resources.au3"
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "GIFAnimation.au3"
#include <StaticConstants.au3>
#include <EditConstants.au3>

$hGui = GUICreate("GIF Animation", 411, 144, -1, -1, $WS_SIZEBOX, $WS_EX_COMPOSITED)

$VS = GUICtrlCreateLabel("TEST TEST TEST", 144, 27, 273 , 38 , $ES_CENTER + $SS_CENTERIMAGE, $WS_EX_TRANSPARENT)
GUICtrlSetColor(-1, 0x787878)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1, 21, 800, 0)

$hGIF = _GUICtrlCreateGIF(@ScriptDir & "\1.gif", "", 10, 10)
if @Compiled then $hGIF = _GUICtrlCreateGIF(@ScriptFullPath, "10;G2", 61, 10)

$B1 = GUICtrlCreateButton('STOP', 12, 71, 131, 41)
$B2 = GUICtrlCreateButton('START', 151, 71, 131, 41)
GUISetState()


While 1
$msg = GUIGetMsg()
 Switch $msg
  Case -3
   exit
  case $B1
  _GIF_PauseAnimation($hGIF)
  case $B2
  _GIF_ResumeAnimation($hGIF)
 EndSwitch
wend

#AutoIt3Wrapper_Res_File_Add=1.gif, rt_rcdata, G2

#include "resources.au3"
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "GIFAnimation.au3"
#include <StaticConstants.au3>
#include <EditConstants.au3>

$hGui = GUICreate("GIF Animation", 411, 144, -1, -1, $WS_SIZEBOX, $WS_EX_COMPOSITED)

$VS = GUICtrlCreateLabel("TEST TEST TEST", 144, 27, 273 , 38 , $ES_CENTER + $SS_CENTERIMAGE, $WS_EX_TRANSPARENT)
GUICtrlSetColor(-1, 0x787878)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1, 21, 800, 0)

$hGIF = _GUICtrlCreateGIF(@ScriptDir & "\1.gif", "", 10, 10)
if @Compiled then $hGIF = _GUICtrlCreateGIF(@ScriptFullPath, "10;G2", 61, 10)

$B1 = GUICtrlCreateButton('STOP', 12, 71, 131, 41)
$B2 = GUICtrlCreateButton('START', 151, 71, 131, 41)
GUISetState()


While 1
$msg = GUIGetMsg()
    Switch $msg
        Case -3
            exit
        case $B1
        _GIF_PauseAnimation($hGIF)
        case $B2
        _GIF_ResumeAnimation($hGIF)
    EndSwitch
wend

There almos what i need, but animation is not working, and if i remove "$WS_SIZEBOX, $WS_EX_COMPOSITED", then animation is fine, but label is on the back of gif.

So how to place labe on top of animated gif?

GIF.rar

Link to comment
Share on other sites

In a single GUI, without flickering, I do not believe it is possible.  If flickers don't bother you, try using _GDIPlus_GraphicsDrawString ($hGraphic,"Label is on top", 80, 96) after each GIF frame display...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...