Jump to content

GIF transparent


Recommended Posts

Dears friends. I am using the command

GUICtrlCreatePic("C:\Tmp\sys.gif ", 10, 130, 0, 0, -1, $WS_EX_LAYERED)

to insert an image (GIF) but are not appearing nothing.

The archive GIF exists and has transparent components.

What it is made a mistake?

The code is:

#include <GuiConstants.au3>

GUICreate("Mensagem", 600, 400, -1, -1)

$font = "Comic Sans MS"

GUICtrlSetFont(-1, 12, 400, 4, $font)

$Pic = GUICtrlCreatePic("C:\Tmp\sys.gif", 10, 130, 0, 0, -1, $WS_EX_LAYERED)

GUISetState()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

Link to comment
Share on other sites

Hello,

when I want to insert a transparent gif in a GUI, I create a secondary GUI with style $WS_POPUP,$WS_EX_LAYERED

It works, but I don't think it's the better way, because we have to manage the moving of the main GUI, to move the second too...

But I don't know another way :(

#include <GuiConstants.au3>

$Maingui=GUICreate("Mensagem", 600, 400)
$guipos=WinGetPos("Mensagem","")
$font = "Comic Sans MS"
GUICtrlSetFont(-1, 12, 400, 4, $font)
GUISetState(@SW_SHOW)
$picGUI=GUICreate("", 150, 150, $guiPos[0]+145, $guiPos[1]+160,$WS_POPUP,$WS_EX_LAYERED,$Maingui); create this gui with the same size parameters than the picture
$Pic = GUICtrlCreatePic("C:\Tmp\sys.gif", 0, 0, 150, 150); My picture is 150*150, adapt to your size

GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case Else
    $guiPos2=WinGetPos($Maingui)
    If $guiPos2[0]<>$guiPos[0] Or $guiPos2[1]<>$guiPos[1] Then winupdate()
EndSelect
WEnd
Exit


Func winupdate()
    $guiPos=WinGetPos($Maingui)
    WinMove($picGUI,"",$guiPos[0]+145,$guiPos[1]+160)
EndFunc
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...