Jump to content
AndroidZero

Animated GIF without flickering

Recommended Posts

AndroidZero

I want to animate transparent GIFs on my gui.
I searched, read and tested a lot UDFs
At the end none fits to me :(

I wrote my own animated function, but its flickering sometimes just for a miliseconds but still doesnt looks good.

edoF9lt.png

 

Below is my code for Testing and also the GIF images you need for it.
GUIChangeImage() is the Animation Function.

CODE:

;************FOR GATHER HTML SOURCE CODE**********************
#include <IE.au3>
#include <InetConstants.au3>
;************FOR GUI***********
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPIFiles.au3>
;**********FOR BUTTON **********
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
;**********FOR STRINGS **********
#include <StringConstants.au3>
#include <String.au3>
;**********FOR COMBOBOX **********
#include <StringConstants.au3>
#include <EditConstants.au3>
#include <GuiEdit.au3>
#include <GuiComboBox.au3>
;**********FOR FONTS **********
#include <FontConstants.au3>
;**********FOR GIF ANIMATION **********
#include <GIFAnimation.au3>
;**********FOR PROCESS **********
#include <Process.au3>
#include <SendMessage.au3>
#include <GDIPlus.au3>
#include <WinAPIDiag.au3>

Opt("GUIOnEventMode",1)

Global Const $SC_DRAGMOVE = 0xF012
Global $hGUIAccountCreator
Global $graphics_path = @ScriptDir & "\graphics"
Global $fontSize_TextBody = 8.5, $fontName_TextBody = "", $fontWeight_TextBody = $FW_BOLD, $fontColor_TextBody = 0x5A2800







GUI_open_AccountCreator()

Func GUI_open_AccountCreator()
Global $hGUIAccountCreator = GUICreate("Tibia Account Creator - SubZero", 350, 400, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Close_AccountCreator")

GUICtrlCreatePic($graphics_path & "\WindowAccountCreator.gif", 0, 0, 350, 400)
GUICtrlSetState(-1, $GUI_DISABLE)

;********* GUI CONTROLS (LABELS,INPUTS,COMBOBOXES) **********************************************************************
GUICtrlCreateLabel(" Create New Account", 25,47,103,14,$SS_CENTERIMAGE)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0xFFFFFF)

GUICtrlCreateLabel("Account Name:",30,75,75,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0x5A2800)
Global $inptBox_Acc = GUICtrlCreateInput("",130,75,150,20)

GUICtrlCreateLabel("Email Adress:",30,100,70,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0x5A2800)
Global $inptBox_Email = GUICtrlCreateInput("",130,100,150,20)

GUICtrlCreateLabel("Password:",30,125,55,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0x5A2800)
Global $inptBox_Passwd = GUICtrlCreateInput("",130,125,150,20,$ES_PASSWORD)
GUICtrlSetData($inptBox_Passwd, "")

GUICtrlCreateLabel("Character Name:",30,170,83,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0x5A2800)
Global $inptBox_CharName = GUICtrlCreateInput("",130,170,150,20)

GUICtrlCreateLabel("Sex:",30,195,23,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,$fontSize_TextBody,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,$fontColor_TextBody)
Global $comboBox_sex = GUICtrlCreateCombo("",130,195,150,20,$CBS_DROPDOWNLIST)
;LoadSexIntoComboBox()

GUICtrlCreateLabel("World Location:",30,240,77)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,$fontSize_TextBody,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,$fontColor_TextBody)
Global $comboBox_world = GUICtrlCreateCombo("",130,240,150,20,BitOr($CBS_DROPDOWNLIST, $WS_VSCROLL))
;LoadWorldsIntoComboBox()

Global $label_status = GUICtrlCreateLabel("",20,360,200,30)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
;********* GUI CONTROLS (LABELS,INPUTS,COMBOBOXES) **********************************************************************


;********* CONTROL PICS **********************************************************************
Global $btn_randAccName = GUICtrlCreatePic($graphics_path & "\Die_Static.gif", 280, 75, 26, 26)
GUICtrlSetTip($btn_randAccName, "Generate a random account name")
GUICtrlSetCursor($btn_randAccName,0)
;GUICtrlSetOnEvent($btn_randAccName,"GenerateRandomAccName")
GUICtrlSetOnEvent($btn_randAccName,"GUIChangeImage")

Global $btn_x = GUICtrlCreatePic("", 315, 5, 40, 36)
GUICtrlSetTip($btn_x, "Close")
GUICtrlSetCursor($btn_x,0)
GUICtrlSetOnEvent($btn_x,"GUI_Close_AccountCreator")

Global $btn_donate = GUICtrlCreatePic("", 112, 313, 126, 47)
GUICtrlSetTip($btn_donate, "Donate")
GUICtrlSetCursor($btn_donate,0)
;GUICtrlSetOnEvent($btn_donate,"Donate")
;********* CONTROL PICS **********************************************************************

    ;********* GDI+ DRAW **********************************************************************
    _GDIPlus_Startup()
    Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\X_Tic-Tac-Toe_Token.gif")
    Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_x, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)
    Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Static.gif")
    Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)
    Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\btn_donateCC_LG.gif")
    Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_donate, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)
    _GDIPlus_Shutdown()
    ;********* GDI+ DRAW **********************************************************************

_WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b)

GUISetIcon(@ScriptDir & "\TibiaInfo.ico")
GUISetState(@SW_SHOW, $hGUIAccountCreator)
WinSetOnTop($hGUIAccountCreator,"",1)
GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")

EndFunc




Func GUIChangeImage()
    _GDIPlus_Startup()
    GUICtrlDelete($btn_randAccName)
    Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26)
    Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame2.gif")
    Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)
    _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b)
    Sleep(100)
    GUICtrlDelete($btn_randAccName)
    Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26)
    Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame3.gif")
    Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)
    _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b)
    Sleep(100)
    GUICtrlDelete($btn_randAccName)
    Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26)
    Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame4.gif")
    Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)
    _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b)
    Sleep(100)
    GUICtrlDelete($btn_randAccName)
    Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26)
    Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame5.gif")
    Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)
    _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b)
    Sleep(100)
    GUICtrlDelete($btn_randAccName)
    Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26)
    GUICtrlSetCursor($btn_randAccName,0)
    GUICtrlSetOnEvent($btn_randAccName,"GUIChangeImage")
    Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Static.gif")
    Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)
    _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b)
    _GDIPlus_Shutdown()
EndFunc

Func GUI_Close_AccountCreator()
    Exit
EndFunc

Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
    _SendMessage($hGUIAccountCreator, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
EndFunc


While 1
    Sleep(10)
WEnd

 

IMAGES:

 

 

btn_donateCC_LG.gif

Die_Frame2.gif

Die_Frame3.gif

Die_Frame4.gif

Die_Frame5.gif

Die_Static.gif

WindowAccountCreator.gif

X_Tic-Tac-Toe_Token.gif

Edited by AndroidZero

Share this post


Link to post
Share on other sites
AndroidZero

Anyone got a good Gif Animation UDF ?

Share this post


Link to post
Share on other sites
KaFu
AndroidZero

I used this UDF before but it didnt work for me well because after using  _GUICtrlCreateGIF(...) the GUI layer was completely misscolored like in my first picture above and it was flickering even more horrible than my own function.
My function is really simple and show every frame with a sleep between. Therefore I needed to save every single frame of my compact gif in my graphics folder.

But here is the GIF you mentioned & the GIFAnimation.au3 that I used before

Die.gif

GIFAnimation.au3

Edited by AndroidZero

Share this post


Link to post
Share on other sites
UEZ

Try something like this here:

;************FOR GATHER HTML SOURCE CODE**********************
#include <IE.au3>
#include <InetConstants.au3>
;************FOR GUI***********
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPIFiles.au3>
;**********FOR BUTTON **********
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
;**********FOR STRINGS **********
#include <StringConstants.au3>
#include <String.au3>
;**********FOR COMBOBOX **********
#include <StringConstants.au3>
#include <EditConstants.au3>
#include <GuiEdit.au3>
#include <GuiComboBox.au3>
;**********FOR FONTS **********
#include <FontConstants.au3>
;**********FOR PROCESS **********
#include <Process.au3>
#include <SendMessage.au3>
#include <GDIPlus.au3>
#include <WinAPIDiag.au3>

Opt("GUIOnEventMode",1)

Global Const $SC_DRAGMOVE = 0xF012
Global $hGUIAccountCreator
Global $graphics_path = @ScriptDir ;& "\graphics"
Global $fontSize_TextBody = 8.5, $fontName_TextBody = "", $fontWeight_TextBody = $FW_BOLD, $fontColor_TextBody = 0x5A2800


GUI_open_AccountCreator()

Func GUI_open_AccountCreator()
Global $hGUIAccountCreator = GUICreate("Tibia Account Creator - SubZero", 350, 400, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Close_AccountCreator")

GUICtrlCreatePic($graphics_path & "\WindowAccountCreator.gif", 0, 0, 350, 400)
GUICtrlSetState(-1, $GUI_DISABLE)

;********* GUI CONTROLS (LABELS,INPUTS,COMBOBOXES) **********************************************************************
GUICtrlCreateLabel(" Create New Account", 25,47,103,14,$SS_CENTERIMAGE)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0xFFFFFF)

GUICtrlCreateLabel("Account Name:",30,75,75,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0x5A2800)
Global $inptBox_Acc = GUICtrlCreateInput("",130,75,150,20)

GUICtrlCreateLabel("Email Adress:",30,100,70,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0x5A2800)
Global $inptBox_Email = GUICtrlCreateInput("",130,100,150,20)

GUICtrlCreateLabel("Password:",30,125,55,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0x5A2800)
Global $inptBox_Passwd = GUICtrlCreateInput("",130,125,150,20,$ES_PASSWORD)
GUICtrlSetData($inptBox_Passwd, "")

GUICtrlCreateLabel("Character Name:",30,170,83,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,0x5A2800)
Global $inptBox_CharName = GUICtrlCreateInput("",130,170,150,20)

GUICtrlCreateLabel("Sex:",30,195,23,14)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,$fontSize_TextBody,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,$fontColor_TextBody)
Global $comboBox_sex = GUICtrlCreateCombo("",130,195,150,20,$CBS_DROPDOWNLIST)
;LoadSexIntoComboBox()

GUICtrlCreateLabel("World Location:",30,240,77)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1,$fontSize_TextBody,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1)
GUICtrlSetColor(-1,$fontColor_TextBody)
Global $comboBox_world = GUICtrlCreateCombo("",130,240,150,20,BitOr($CBS_DROPDOWNLIST, $WS_VSCROLL))
;LoadWorldsIntoComboBox()

Global $label_status = GUICtrlCreateLabel("",20,360,200,30)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
;********* GUI CONTROLS (LABELS,INPUTS,COMBOBOXES) **********************************************************************


;********* CONTROL PICS **********************************************************************
Global $btn_randAccName = GUICtrlCreatePic("", 280, 75)
GUICtrlSetTip($btn_randAccName, "Generate a random account name")
GUICtrlSetCursor($btn_randAccName,0)
;GUICtrlSetOnEvent($btn_randAccName,"GenerateRandomAccName")
GUICtrlSetOnEvent($btn_randAccName,"GUIChangeImage")

Global $btn_x = GUICtrlCreatePic("", 315, 5, 40, 36)
GUICtrlSetTip($btn_x, "Close")
GUICtrlSetCursor($btn_x,0)
GUICtrlSetOnEvent($btn_x,"GUI_Close_AccountCreator")

Global $btn_donate = GUICtrlCreatePic("", 112, 313, 126, 47)
GUICtrlSetTip($btn_donate, "Donate")
GUICtrlSetCursor($btn_donate,0)
;GUICtrlSetOnEvent($btn_donate,"Donate")
;********* CONTROL PICS **********************************************************************

    ;********* GDI+ DRAW **********************************************************************
    _GDIPlus_Startup()
    Global $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\X_Tic-Tac-Toe_Token.gif")
    Global $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_x, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)

    Global $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\btn_donateCC_LG.gif")
    Global $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_donate, 0x0172, $IMAGE_BITMAP, $hHBMP))
    _GDIPlus_ImageDispose($hImg)

    Global $aGIFs[6]
    For $i = 2 To 5
        $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame" & $i & ".gif")
        $aGIFs[$i - 1] = _GDIPlus_Convert2HBitmap($hImg, 0xD4C0A1, 32, 32)
        _GDIPlus_ImageDispose($hImg)
    Next
    $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Static.gif")
    $aGIFs[0] = _GDIPlus_Convert2HBitmap($hImg, 0xD4C0A1, 32, 32)
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $aGIFs[0]))
    _GDIPlus_ImageDispose($hImg)
    _GDIPlus_Shutdown()
    ;********* GDI+ DRAW **********************************************************************

_WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b)

GUISetIcon(@ScriptDir & "\TibiaInfo.ico")
GUISetState(@SW_SHOW, $hGUIAccountCreator)
WinSetOnTop($hGUIAccountCreator,"",1)
GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")

EndFunc




Func GUIChangeImage()
    For $i = 1 to 4
        _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $aGIFs[$i]))
        Sleep(200)
    Next
    _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $aGIFs[0]))
EndFunc

Func GUI_Close_AccountCreator()
    For $i = 0 To 5
        _WinAPI_DeleteObject($aGIFs[$i])
    Next
    Exit
EndFunc

Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
    _SendMessage($hGUIAccountCreator, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
EndFunc


While 1
    Sleep(100)
WEnd

Func _GDIPlus_Convert2HBitmap($hBitmap, $iBgColor, $iNewW = 0, $iNewH = 0)
    Local $iWidth, $iHeight
    If $iNewW Then
        $iWidth = $iNewW
    Else
        $iWidth = _GDIPlus_ImageGetWidth($hBitmap)
    EndIf
    If $iNewH Then
        $iHeight = $iNewH
    Else
        $iHeight = _GDIPlus_ImageGetHeight($hBitmap)
    EndIf
    Local $hBitmap_new = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) ;$aResult[6]
    Local $hCtx_new = _GDIPlus_ImageGetGraphicsContext($hBitmap_new)
    _GDIPlus_GraphicsSetPixelOffsetMode($hCtx_new, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)
    Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iBgColor)
    _GDIPlus_GraphicsFillRect($hCtx_new, 0, 0, $iWidth, $iHeight, $hBrush)
    _GDIPlus_GraphicsDrawImageRect($hCtx_new, $hBitmap, 0, 0, $iWidth, $iHeight)
    Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_new)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_BitmapDispose($hBitmap_new)
    _GDIPlus_GraphicsDispose($hCtx_new)
    Return $hHBITMAP
EndFunc   ;==>_GDIPlus_Convert2HBitmap

 

  • Like 1

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
AndroidZero

@UEZ: Thank you again !! It works sooo goooood :lmao:

Edited by AndroidZero

Share this post


Link to post
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

  • Similar Content

    • QaisBsharat
      By QaisBsharat
      Hello, 
      May i know how can i automation qt application?
      Using controlclick not mouse and positions
       
      Thanks
    • nooneclose
      By nooneclose
      Good afternoon, I am in need of some help. I am sure this is a stupid question requiring only one or two lines of code. However, I would greatly appreciate the help I cannot figure this out. I also tried searching for the answer on the internet but no one except me apparently seems to be having a hard time figuring this out and or is asking about it. 
      I simply want to change the "status" of an email from unread to read once I have processed it. My code is over 500 lines and I would like not to clutter this post with it. Assume I have all my includes and connections properly defined and stuff. 
      Here is the bit of code where I am trying to change the email that was used from unread to read:
      Func ChangeEmailStatus() ;******************************************************************************* ; changes the status of an email from unread to Read ;******************************************************************************* Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (Before Change)", $iRows) _OL_ItemModify($oOutlook,$aItems[$i][0], Default, "Read=True") MsgBox("", "Array Display 1", $aItems[1][0]) MsgBox("", "Array Display 2", $aItems[2][0]) Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (After Change)", $iRows) EndFunc  
    • SharpDressedMan
      By SharpDressedMan
      Hello,
      Is there any way to check for validity of a pointer to a DllStruct ?
      In the above code, a DllStruct is created from an invalid pointer. How to prevent from doing this ?
      local $tStruct = DllStructCreate("int i") DllStructSetData($tStruct, "i", 123) local $pStruct = DllStructGetPtr($tStruct) $tStruct = 0 ; destroy DllStruct ==> $pStruct becomes invalid ; how to check here for validity of $pStruct and prevent from doing the following ? $tStruct = DllStructCreate("int i", $pStruct) ; create DllStruct from invalid pointer... MsgBox(0, @ScriptName, @error) ; displays '0' : invalid pointer is not detected by DllStructCreate() MsgBox(0, @ScriptName, IsDllStruct($tStruct)) ; displays '1' : tStruct is assumed as a valid DllStruct object, which is not Thanks for help
    • nooneclose
      By nooneclose
      I need to send a string of text to this popup and click on the ok button to save it.
      Here is the code I have so far:
      ;Start IE Sleep(7000) $oIE = _IECreate("http://www.google.com") Sleep(500) _IELoadWait($oIE) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window Sleep(500) WinSetState($hIE, "", @SW_MAXIMIZE) ;Wait for a browser page load to complete Sleep(3000) _IENavigate($oIE, "https://properURL.com") Sleep(8000) _IELoadWait($oIE) ;Attach to a browser control embedded in another window $oIE = _IEAttach("https://"properURL.com", url") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oIE = ' & $oIE & @CRLF & '>Error code: ' & @error & ' Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console Sleep(2000) ;Get the title of the webpage ;Local $wTitle = _IEPropertyGet($oIE, "title") ;MsgBox($MB_SYSTEMMODAL, "Webpage title:", $wTitle) ;Clicks the new button Sleep(3000) _IEAction($nWorkOrderB, "focus") _IEAction($nWorkOrderB, "click") Sleep(5000) ;Store the Element names where the important data will be sent ;Store the long description button Local $wLongDButton = _IEGetObjById($oIE, "m65d795a4-img") ;Store the long Description field id Local $wComments = _IEGetObjById($oIE, "ma6499a9c-rte_iframe") ;Store the ok button id that is in the long description Local $wCommOk = _IEGetObjById($oIE, "m74031266-pb") ;******************************************************************************* ; Send the stored data to the proper field ;******************************************************************************* ;Click the long description button Sleep(300) _IEAction($wLongDButton, "focus") _IEAction($wLongDButton, "click") Sleep(300) ;Sends the Comments Sleep(500) _IEAction($wComments, "focus") _IEAction($wComments, "click") Sleep(500) _IEFormElementSetValue($wComments, "hello darkness my old friend") ;Click the ok button Sleep(500) _IEAction($wCommOk, "focus") _IEAction($wCommOk, "click") Sleep(500)  
      Here is the popup:

    • yasha
      By yasha
      i want am trying to select a nimber to run a program and then select where to save the excel result at before hand
      the problem is that it does not save in the folder i want but the folder before any solutions
      #.................
      $sFolder = ""
          ; Create a constant variable in Local scope of the message to display in FileSelectFolder.
          Local Const $sMessage = "Select a folder"
          ; Display an open dialog to select a file.
          $sFileSelectFolder = FileSelectFolder($sMessage, $sFolder)
          If @error Then
              ; Display the error message.
              MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
          Else
              ; Display the selected folder.
              MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder)
          EndIf
      .......
      ........
      $oExcel = ObjCreate("Excel.Application")                   ; Create an Excel Object
      $oExcel.Visible = 1                                        ; Let Excel show itself
      $oExcel.Workbooks.Open("J:\OPS\OPS_Share\Planners\2 - Weekly Reports\Auto download\"& $YY & $MM & $DD & " ORDER.xls",0)
      $oExcel.ActiveWorkbook.Saveas ( $sFileSelectFolder,""& $YY & $MM & $DD & " ORDER.xlsx", 1)
      $oExcel.ActiveWorkBook.Close
      $oExcel.Quit
      i only want to save it as ddmmyy order inside documents but it saves in libraries as documents ddmmyy order.
×