Jump to content
Sign in to follow this  
Belini

Problem to use ExStyle in pic.

Recommended Posts

Belini

When I use any edge of the image goes out of pic when I use GUICtrlSetImage (), how to solve?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

main1()
main2()

Func main1()
    Local $gui = GUICreate("GUI Pic", 300, 300, -1, -1)
    GUICtrlCreateLabel("Using the edge pic", 56, 8, 154, 24)
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
    Local $pic = GUICtrlCreatePic(_image1(True), 40, 40, 200, 200)
    GUICtrlSetStyle(-1, "", $WS_EX_OVERLAPPEDWINDOW);
    GUISetState()

    Local $i = 0
    Local $image = 1
    While $i < 15
        $i += 1

        If $image = 1 Then
            $image = 0
            GUICtrlSetImage($pic, _image1(True))
        Else
            $image = 1
            GUICtrlSetImage($pic, _image2(True))
        EndIf

        Sleep(500)
    WEnd

    GUIDelete($pic)
EndFunc   ;==>main1

Func main2()
    Local $gui = GUICreate("GUI Pic", 300, 300, -1, -1)
    GUICtrlCreateLabel("Without using the edge pic", 56, 8, 170, 24)
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
    Local $pic = GUICtrlCreatePic(_image1(True), 40, 40, 200, 200)
    GUISetState()

    Local $i = 0
    Local $image = 1
    While $i < 10
        $i += 1

        If $image = 1 Then
            $image = 0
            GUICtrlSetImage($pic, _image1(True))
        Else
            $image = 1
            GUICtrlSetImage($pic, _image2(True))
        EndIf

        Sleep(500)
    WEnd

    GUIDelete($pic)
EndFunc   ;==>main2


; #FUNCTION# ====================================================================================================================
; Name ..........: _image1()
; Description ...: Compressed file embedded in your .au3 file
; Syntax ........: _image2( [ lToSave [, sPath [, lExecute ]]] )
; Parameters ....: lToSave             - [optional] If True, save the file, else, return binary data. Default is False.
;                  sPath               - [optional] The path of the file to be save. Default is @TempDir
;                  lExecute            - [optional] Flag to execute file saved. Default is False
; Return values .: Success             - Returns decompressed image2.jpg binary data or saved.
;                    Failure             - Returns 0 and set @error to 1.
; Author(s) .....: João Carlos (Jscript FROM Brazil)
; Modified ......:
; Remarks .......: This function uses _LZNTDecompress() and _Base64Decode() by trancexx.
; Related .......:
; Link ..........:
; Example .......; _image2()
; ===============================================================================================================================

Func _image1($lToSave = False, $sPath = @TempDir, $lExecute = False)
    Local $hFileHwnd, $bData, $sFileName = $sPath & "\image1.JPG"

    ; Original: E:\image1.JPG
    $bData = "QrcA/9j/4AAQSkYASUYAAQEBAGABABAA/9sAQwAIAAYGBwYFCAcHAAcJCQgKDBQNAAwLCwwZEhMPABQdGh8eHRocABwgJC4nICIsACMcHCg3KSwwADE0NDQfJzk9gDgyPC4zNDIBiAABCQkJDAsMGAANDRgyIRwhMgEuAP/AABEIAD4AAD4DASIAAhEAAQMRAf/EAB+wAAABBQCtAbAAAwAAAQIDBAUGBwgICQoLACC1EAACAAEDAwIEAwUFFAQEAC19AB8ABBEABRIhMUEGE1EAYQcicRQygZEAoQgjQrHBFVIA0fAkM2JyggkAChYXGBkaJSYAJygpKjQ1NjcAODk6Q0RFRkcASElKU1RVVlcAWFlaY2RlZmcAaGlqc3R1dncAeHl6g4SFhocAiImKkpOUlZYAl5iZmqKjpKUApqeoqaqys7QAtba3uLm6wsMAxMXGx8jJytIA09TV1tfY2doA4eLj5OXm5+gA6erx8vP09fYQ9/j5+"
    $bData &= "oFrAQADFwNrhmyMaxGAawIEBAgDBAeBawECdwABABARBAUhMQYSAEFRB2FxEyIyAIEIFEKRobHBAAkjM1LwFWJyANEKFiQ04SXxdwFtgmwjbIJyNgY2xzXaEAAMAwEAbwMRAAA/AMLNWbOyuAC+l8uCMsep9AAD1J7UabYS6gBXqW8Q5Y8k9AADuTXcSpZ6DgCcFAOzIAAGXgBn9Mdz+gr1KwBWVPRbnnUqTgB6vYxINBt4cQDns0z+icL+fQBP5VYaDT4PlQCt7VP+uj8/qQCtCz0qbVMS6gAyvFC3Itbd9gCMf7Tjkn6YFQDQWnhXR1TEegBdr9TEGP5nmgDjlKo9WzqjGg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fpx+tQDUa2xtrWEE8gDsTj/P1pngDwAPyQ2r6pchvADLldkAckkR9wBufXAA9h71nQDijUUutUZIWAAYofkUjvjqfwA6"
    $bData &= "UW6tb0HJcgBS9TGs7yWyuQCOeFyjo25WHQCNehW2paf4mwBMktrmJGLKPADrcnkf7Sn+RwC3evI/7U/6YwD/AI9/9apYdQC5IJFeNGVlOQBWV8EfQ4ratQA41NU9TGlVcADR7HU3vgq7sQC4Mmnv9rt85AAvAlX6jv8AUQD5CprVp7ddkgAZImHUOCP51QBLLx1NsAvbfwA1R/Gh2t+I6AB/SuhtfEsdzABBo2uVHo2P8QCso4qdP3ZK5gCSw8KusXYxbgBtLy/OyCOaYgB/uqSPz6Vc0QB8FxRTrc6sywApBytshyM/7QCe/wBB+dSX/gAthtRh1uZD2AAcY/nXN6j4ygDycGNU8mM9kQDwSPdv8MUSrwBSt7q0Q40oUQDV6nZ+IvE6QQAL2Vk4MzDbJACL0jH90e/b2gC4Nn3HJrNOqiBP/LHjsCBU1qQA/tT/AKY/+PcA/wBat6MYU1YAMKlRzZ//2Q=="

    If $lToSave Then
        $hFileHwnd = FileOpen($sFileName, 10)
        If @error Then Return SetError(1, 0, 0)
        FileWrite($hFileHwnd, __image1(__image1B64($bData)))
        FileClose($hFileHwnd)
        If $lExecute Then
            RunWait($sFileName, "")
            FileDelete($sFileName)
            Return 1
        EndIf
        If FileExists($sFileName) Then Return $sFileName
    Else
        Return __image1(__image1B64($bData))
    EndIf

    Return SetError(1, 0, 0)
EndFunc   ;==>_image1

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __image1B64
; Description ...: Base64 decode input data.
; Syntax.........: __image1B64($bBinary)
; Parameters ....: $sInput - String data to decode
; Return values .: Success - Returns decode binary data.
;                          - Sets @error to 0
;                  Failure - Returns empty string and sets @error:
;                  |1 - Error calculating the length of the buffer needed.
;                  |2 - Error decoding.
; Author ........: trancexx
; Modified ......: João Carlos (Jscript FROM Brazil)
; Related .......: _Base64Encode()
; ===============================================================================================================================
Func __image1B64($sInput)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
            "str", $sInput, _
            "int", 0, _
            "int", 1, _
            "ptr", 0, _
            "ptr", DllStructGetPtr($struct, 1), _
            "ptr", 0, _
            "ptr", 0)
    If @error Or Not $a_Call[0] Then
        Return SetError(1, 0, "") ; error calculating the length of the buffer needed
    EndIf
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
            "str", $sInput, _
            "int", 0, _
            "int", 1, _
            "ptr", DllStructGetPtr($a), _
            "ptr", DllStructGetPtr($struct, 1), _
            "ptr", 0, _
            "ptr", 0)
    If @error Or Not $a_Call[0] Then
        Return SetError(2, 0, ""); error decoding
    EndIf
    Return DllStructGetData($a, 1)
EndFunc   ;==>__image1B64

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __image1
; Original Name..: _LZNTDecompress
; Description ...: Decompresses input data.
; Syntax.........: __image1($bBinary)
; Parameters ....: $vInput - Binary data to decompress.
; Return values .: Success - Returns decompressed binary data.
;                          - Sets @error to 0
;                  Failure - Returns empty string and sets @error:
;                  |1 - Error decompressing.
; Author ........: trancexx
; Related .......: _LZNTCompress
; Link ..........; http://msdn.microsoft.com/en-us/library/bb981784.aspx
; ===============================================================================================================================
Func __image1($bBinary)
    $bBinary = Binary($bBinary)
    Local $tInput = DllStructCreate("byte[" & BinaryLen($bBinary) & "]")
    DllStructSetData($tInput, 1, $bBinary)
    Local $tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize($tInput) & "]") ; initially oversizing buffer
    Local $a_Call = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _
            "ushort", 2, _
            "ptr", DllStructGetPtr($tBuffer), _
            "dword", DllStructGetSize($tBuffer), _
            "ptr", DllStructGetPtr($tInput), _
            "dword", DllStructGetSize($tInput), _
            "dword*", 0)

    If @error Or $a_Call[0] Then
        Return SetError(1, 0, "") ; error decompressing
    EndIf

    Local $tOutput = DllStructCreate("byte[" & $a_Call[6] & "]", DllStructGetPtr($tBuffer))

    Return SetError(0, 0, DllStructGetData($tOutput, 1))
EndFunc   ;==>__image1

Func _image2($lToSave = False, $sPath = @TempDir, $lExecute = False)
    Local $hFileHwnd, $bData, $sFileName = $sPath & "\image2.jpg"

    ; Original: E:\image2.jpg
    $bData = "XrsA/9j/4AAQSkYASUYAAQIBAGABABAA/+EIg0V4AGlmAABNTQAqAAAAAAgABwESBAADACQBAAEAABABGgAFAiwAAGJEARsGFmoBKARGAkkARjEAAAoAYwBOchQBMgIWFAAW1YdpTAAEAA4AigDsAEoYSAAOpgAOJxAFB0EAZG9iZSBQaG8AdG9zaG9wIEMAUzQgKDExLjAAeDIwMDcxMTAIMSBbBQkubS4xCDkwIAEOLzExLwAwMTowMjowMAEAAiBjdXRvZmYAOyBtIGJyYW4AY2hdKSAgV2kAbmRvd3MAMjAEMTQBKTExIDA3QDoyMTo0OQBBABAAA6ABg1///wCIAKAChlM+oAOHBUGCFAAABgEDhHUGk4BihocBZoeHAW6Jh6OArYR7AXYChi0HgaM9ASlIAAKBiYIDiskAAIJIgAAA/+0ADIKNAF9DTQAC/+4AIg6CBgBkgIEc/9sAAIQADAgICAkACAwJCQwRCwoACxEVDwwMD"
    $bData &= "xUAGBMTFRMTGBEeDAIABAMDBo0CAQ0LAAsNDg0QDg4QIBQODg4UAQEOFB2DDBFEDoQBExD/wAAAEQgAPgA+AwEAIgACEQEDEQEE/92ATgT/xAE/uYBJBQECAAAsgQADAJwABAUGBwgJCgtDgJULBwEAAgMFBxAAAAEEAQMCBAIABQcGCAUDDDMBAAcRAwQhEjEFAEFRYRMicYEyAAYUkaGxQiMkABVSwWIzNHKCANFDByWSU/DhAPFjczUWorKDACZEk1RkRcKjAHQ2F9JV4mXyALOEw9N14/NGACeUpIW0lcTUAOT0pbXF1eX1AFZmdoaWprbGANbm9jdHV2d3AIeXp7fH1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Akn/NeIlTGWoA5Fh99aWsjEQAfNflLL/zXlgADxM4aqQZ7+UAZ5RuILeTW70ADetfp6VishYAZhb/ALUnx/4A/OKpF/xWn/EAZhiHoNDj9NoAYT6zYS+cbesAIv1G3ZrZZOwASyGMv/yMbBQA66Wb/CAH/9UAJbfUry1uorkAt3McsTc43HYAbICVPLaXIMYAXoVtq+jeadIAZrK8hRy6L9YA7An4h/xZE38Ay"
    $bData &= "af/AHX/ALsAclxW9DizDIEAiF1+X+pafdkAl0p/0hZVqscA8K3Sf6y0+P8AANeP/kVHgMUg1er7OoaQTzSyAJ54kEczSQOPALSyB1/4nlMrAHSSxZIHZSvoAPUbj93aRzXLADfyK7L/AMFQAKZOOzZj0c8hAN2tF8hQNcreAGvMtwQeUenxAJ5Ly/4vanx/AOpH/wAjctAtIOi0fZ8YQDEfagBr5m83RWsL6QC6a4N044XE6QD2Yl/32u/2/wAAY/4ryKdXqwCwwfrRu4xdFwCL6n//1okt3gFQMSwf8lk/plYAXjZiPeq211oA79Zi+rWL/WMAl+49KVfUr/kAFBXCCXN03EMA6d2XWmp+eY0AVTUtG9dR0mgApoUf/Zrz9NsA/knh3d7iM/4AIJ9a3PmJ4wQAWl5EP5WMR/UASHJByCcfX9IAoalfeYo6FtMAruY/sh2gVfwAZBjNiDHoxnUAS/8APskEhGkAbw26/aSCVDIAFf8AKZ"
    $bData &= "GZz/wA8lTIC+jr9ScAJ0/QxQ3Oq7EAWyHH9keqn9MAIG3VT81T61oAxw/3h/5LR/0AMO7j1Hvf/9k="

    If $lToSave Then
        $hFileHwnd = FileOpen($sFileName, 10)
        If @error Then Return SetError(1, 0, 0)
        FileWrite($hFileHwnd, __image2(__image2B64($bData)))
        FileClose($hFileHwnd)
        If $lExecute Then
            RunWait($sFileName, "")
            FileDelete($sFileName)
            Return 1
        EndIf
        If FileExists($sFileName) Then Return $sFileName
    Else
        Return __image2(__image2B64($bData))
    EndIf

    Return SetError(1, 0, 0)
EndFunc   ;==>_image2

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __image2B64
; Description ...: Base64 decode input data.
; Syntax.........: __image2B64($bBinary)
; Parameters ....: $sInput - String data to decode
; Return values .: Success - Returns decode binary data.
;                          - Sets @error to 0
;                  Failure - Returns empty string and sets @error:
;                  |1 - Error calculating the length of the buffer needed.
;                  |2 - Error decoding.
; Author ........: trancexx
; Modified ......: João Carlos (Jscript FROM Brazil)
; Related .......: _Base64Encode()
; ===============================================================================================================================
Func __image2B64($sInput)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
            "str", $sInput, _
            "int", 0, _
            "int", 1, _
            "ptr", 0, _
            "ptr", DllStructGetPtr($struct, 1), _
            "ptr", 0, _
            "ptr", 0)
    If @error Or Not $a_Call[0] Then
        Return SetError(1, 0, "") ; error calculating the length of the buffer needed
    EndIf
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
            "str", $sInput, _
            "int", 0, _
            "int", 1, _
            "ptr", DllStructGetPtr($a), _
            "ptr", DllStructGetPtr($struct, 1), _
            "ptr", 0, _
            "ptr", 0)
    If @error Or Not $a_Call[0] Then
        Return SetError(2, 0, ""); error decoding
    EndIf
    Return DllStructGetData($a, 1)
EndFunc   ;==>__image2B64

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __image2
; Original Name..: _LZNTDecompress
; Description ...: Decompresses input data.
; Syntax.........: __image2($bBinary)
; Parameters ....: $vInput - Binary data to decompress.
; Return values .: Success - Returns decompressed binary data.
;                          - Sets @error to 0
;                  Failure - Returns empty string and sets @error:
;                  |1 - Error decompressing.
; Author ........: trancexx
; Related .......: _LZNTCompress
; Link ..........; http://msdn.microsoft.com/en-us/library/bb981784.aspx
; ===============================================================================================================================
Func __image2($bBinary)
    $bBinary = Binary($bBinary)
    Local $tInput = DllStructCreate("byte[" & BinaryLen($bBinary) & "]")
    DllStructSetData($tInput, 1, $bBinary)
    Local $tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize($tInput) & "]") ; initially oversizing buffer
    Local $a_Call = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _
            "ushort", 2, _
            "ptr", DllStructGetPtr($tBuffer), _
            "dword", DllStructGetSize($tBuffer), _
            "ptr", DllStructGetPtr($tInput), _
            "dword", DllStructGetSize($tInput), _
            "dword*", 0)

    If @error Or $a_Call[0] Then
        Return SetError(1, 0, "") ; error decompressing
    EndIf

    Local $tOutput = DllStructCreate("byte[" & $a_Call[6] & "]", DllStructGetPtr($tBuffer))

    Return SetError(0, 0, DllStructGetData($tOutput, 1))
EndFunc   ;==>__image2

Share this post


Link to post
Share on other sites
Belini
Belini

I solved adding $ SS_CENTERIMAGE Style

GUICtrlSetStyle(-1, $SS_CENTERIMAGE + $WS_DLGFRAME, $WS_EX_CLIENTEDGE)

 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

main1()

Func main1()
    Local $gui = GUICreate("GUI Pic", 300, 300, -1, -1)
    GUICtrlCreateLabel("Using the edge pic", 56, 8, 154, 24)
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
    Local $pic = GUICtrlCreatePic(_image1(True), 40, 40, 200, 200)
    GUICtrlSetStyle(-1, $SS_CENTERIMAGE + $WS_DLGFRAME, $WS_EX_CLIENTEDGE)
    GUISetState()

    Local $i = 0
    Local $image = 1
    While $i < 15
        $i += 1

        If $image = 1 Then
            $image = 0
            GUICtrlSetImage($pic, _image1(True))
        Else
            $image = 1
            GUICtrlSetImage($pic, _image2(True))
        EndIf

        Sleep(500)
    WEnd

    GUIDelete($pic)
EndFunc   ;==>main1

; #FUNCTION# ====================================================================================================================
; Name ..........: _image1()
; Description ...: Compressed file embedded in your .au3 file
; Syntax ........: _image2( [ lToSave [, sPath [, lExecute ]]] )
; Parameters ....: lToSave             - [optional] If True, save the file, else, return binary data. Default is False.
;                  sPath               - [optional] The path of the file to be save. Default is @TempDir
;                  lExecute            - [optional] Flag to execute file saved. Default is False
; Return values .: Success             - Returns decompressed image2.jpg binary data or saved.
;                     Failure             - Returns 0 and set @error to 1.
; Author(s) .....: João Carlos (Jscript FROM Brazil)
; Modified ......:
; Remarks .......: This function uses _LZNTDecompress() and _Base64Decode() by trancexx.
; Related .......:
; Link ..........:
; Example .......; _image2()
; ===============================================================================================================================

Func _image1($lToSave = False, $sPath = @TempDir, $lExecute = False)
    Local $hFileHwnd, $bData, $sFileName = $sPath & "\image1.JPG"

    ; Original: E:\image1.JPG
    $bData = "QrcA/9j/4AAQSkYASUYAAQEBAGABABAA/9sAQwAIAAYGBwYFCAcHAAcJCQgKDBQNAAwLCwwZEhMPABQdGh8eHRocABwgJC4nICIsACMcHCg3KSwwADE0NDQfJzk9gDgyPC4zNDIBiAABCQkJDAsMGAANDRgyIRwhMgEuAP/AABEIAD4AAD4DASIAAhEAAQMRAf/EAB+wAAABBQCtAbAAAwAAAQIDBAUGBwgICQoLACC1EAACAAEDAwIEAwUFFAQEAC19AB8ABBEABRIhMUEGE1EAYQcicRQygZEAoQgjQrHBFVIA0fAkM2JyggkAChYXGBkaJSYAJygpKjQ1NjcAODk6Q0RFRkcASElKU1RVVlcAWFlaY2RlZmcAaGlqc3R1dncAeHl6g4SFhocAiImKkpOUlZYAl5iZmqKjpKUApqeoqaqys7QAtba3uLm6wsMAxMXGx8jJytIA09TV1tfY2doA4eLj5OXm5+gA6erx8vP09fYQ9/j5+"
    $bData &= "oFrAQADFwNrhmyMaxGAawIEBAgDBAeBawECdwABABARBAUhMQYSAEFRB2FxEyIyAIEIFEKRobHBAAkjM1LwFWJyANEKFiQ04SXxdwFtgmwjbIJyNgY2xzXaEAAMAwEAbwMRAAA/AMLNWbOyuAC+l8uCMsep9AAD1J7UabYS6gBXqW8Q5Y8k9AADuTXcSpZ6DgCcFAOzIAAGXgBn9Mdz+gr1KwBWVPRbnnUqTgB6vYxINBt4cQDns0z+icL+fQBP5V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uNwBj9Ox9q8/1PQA2zgB2REfSRgD/ABrmLkRqxAAm8fSRv8aX1QCnfmvqNYiDXAC2NrTLK4/4SwAgsp42SWGUmQAU9tvOfpx+tQDUa2xtrWEE8gDsTj/P1pngDwAPyQ2r6pchvADLldkAckkR9wBufXAA9h71nQDijUUutUZIWAAYofkUjvjqfwA6"
    $bData &= "UW6tb0HJcgBS9TGs7yWyuQCOeFyjo25WHQCNehW2paf4mwBMktrmJGLKPADrcnkf7Sn+RwC3evI/7U/6YwD/AI9/9apYdQC5IJFeNGVlOQBWV8EfQ4ratQA41NU9TGlVcADR7HU3vgq7sQC4Mmnv9rt85AAvAlX6jv8AUQD5CprVp7ddkgAZImHUOCP51QBLLx1NsAvbfwA1R/Gh2t+I6AB/SuhtfEsdzABBo2uVHo2P8QCso4qdP3ZK5gCSw8KusXYxbgBtLy/OyCOaYgB/uqSPz6Vc0QB8FxRTrc6sywApBytshyM/7QCe/wBB+dSX/gAthtRh1uZD2AAcY/nXN6j4ygDycGNU8mM9kQDwSPdv8MUSrwBSt7q0Q40oUQDV6nZ+IvE6QQAL2Vk4MzDbJACL0jH90e/b2gC4Nn3HJrNOqiBP/LHjsCBU1qQA/tT/AKY/+PcA/wBat6MYU1YAMKlRzZ//2Q=="

    If $lToSave Then
        $hFileHwnd = FileOpen($sFileName, 10)
        If @error Then Return SetError(1, 0, 0)
        FileWrite($hFileHwnd, __image1(__image1B64($bData)))
        FileClose($hFileHwnd)
        If $lExecute Then
            RunWait($sFileName, "")
            FileDelete($sFileName)
            Return 1
        EndIf
        If FileExists($sFileName) Then Return $sFileName
    Else
        Return __image1(__image1B64($bData))
    EndIf

    Return SetError(1, 0, 0)
EndFunc   ;==>_image1

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __image1B64
; Description ...: Base64 decode input data.
; Syntax.........: __image1B64($bBinary)
; Parameters ....: $sInput - String data to decode
; Return values .: Success - Returns decode binary data.
;                          - Sets @error to 0
;                  Failure - Returns empty string and sets @error:
;                  |1 - Error calculating the length of the buffer needed.
;                  |2 - Error decoding.
; Author ........: trancexx
; Modified ......: João Carlos (Jscript FROM Brazil)
; Related .......: _Base64Encode()
; ===============================================================================================================================
Func __image1B64($sInput)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
            "str", $sInput, _
            "int", 0, _
            "int", 1, _
            "ptr", 0, _
            "ptr", DllStructGetPtr($struct, 1), _
            "ptr", 0, _
            "ptr", 0)
    If @error Or Not $a_Call[0] Then
        Return SetError(1, 0, "") ; error calculating the length of the buffer needed
    EndIf
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
            "str", $sInput, _
            "int", 0, _
            "int", 1, _
            "ptr", DllStructGetPtr($a), _
            "ptr", DllStructGetPtr($struct, 1), _
            "ptr", 0, _
            "ptr", 0)
    If @error Or Not $a_Call[0] Then
        Return SetError(2, 0, ""); error decoding
    EndIf
    Return DllStructGetData($a, 1)
EndFunc   ;==>__image1B64

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __image1
; Original Name..: _LZNTDecompress
; Description ...: Decompresses input data.
; Syntax.........: __image1($bBinary)
; Parameters ....: $vInput - Binary data to decompress.
; Return values .: Success - Returns decompressed binary data.
;                          - Sets @error to 0
;                  Failure - Returns empty string and sets @error:
;                  |1 - Error decompressing.
; Author ........: trancexx
; Related .......: _LZNTCompress
; Link ..........; http://msdn.microsoft.com/en-us/library/bb981784.aspx
; ===============================================================================================================================
Func __image1($bBinary)
    $bBinary = Binary($bBinary)
    Local $tInput = DllStructCreate("byte[" & BinaryLen($bBinary) & "]")
    DllStructSetData($tInput, 1, $bBinary)
    Local $tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize($tInput) & "]") ; initially oversizing buffer
    Local $a_Call = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _
            "ushort", 2, _
            "ptr", DllStructGetPtr($tBuffer), _
            "dword", DllStructGetSize($tBuffer), _
            "ptr", DllStructGetPtr($tInput), _
            "dword", DllStructGetSize($tInput), _
            "dword*", 0)

    If @error Or $a_Call[0] Then
        Return SetError(1, 0, "") ; error decompressing
    EndIf

    Local $tOutput = DllStructCreate("byte[" & $a_Call[6] & "]", DllStructGetPtr($tBuffer))

    Return SetError(0, 0, DllStructGetData($tOutput, 1))
EndFunc   ;==>__image1

Func _image2($lToSave = False, $sPath = @TempDir, $lExecute = False)
    Local $hFileHwnd, $bData, $sFileName = $sPath & "\image2.jpg"

    ; Original: E:\image2.jpg
    $bData = "XrsA/9j/4AAQSkYASUYAAQIBAGABABAA/+EIg0V4AGlmAABNTQAqAAAAAAgABwESBAADACQBAAEAABABGgAFAiwAAGJEARsGFmoBKARGAkkARjEAAAoAYwBOchQBMgIWFAAW1YdpTAAEAA4AigDsAEoYSAAOpgAOJxAFB0EAZG9iZSBQaG8AdG9zaG9wIEMAUzQgKDExLjAAeDIwMDcxMTAIMSBbBQkubS4xCDkwIAEOLzExLwAwMTowMjowMAEAAiBjdXRvZmYAOyBtIGJyYW4AY2hdKSAgV2kAbmRvd3MAMjAEMTQBKTExIDA3QDoyMTo0OQBBABAAA6ABg1///wCIAKAChlM+oAOHBUGCFAAABgEDhHUGk4BihocBZoeHAW6Jh6OArYR7AXYChi0HgaM9ASlIAAKBiYIDiskAAIJIgAAA/+0ADIKNAF9DTQAC/+4AIg6CBgBkgIEc/9sAAIQADAgICAkACAwJCQwRCwoACxEVDwwMD"
    $bData &= "xUAGBMTFRMTGBEeDAIABAMDBo0CAQ0LAAsNDg0QDg4QIBQODg4UAQEOFB2DDBFEDoQBExD/wAAAEQgAPgA+AwEAIgACEQEDEQEE/92ATgT/xAE/uYBJBQECAAAsgQADAJwABAUGBwgJCgtDgJULBwEAAgMFBxAAAAEEAQMCBAIABQcGCAUDDDMBAAcRAwQhEjEFAEFRYRMicYEyAAYUkaGxQiMkABVSwWIzNHKCANFDByWSU/DhAPFjczU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sNXeM2Eu0AFgtA/wBksWEAx5F2Zv8AifwAGV3bqMmaU2YAdj5Y0S4iBkgAKt7vL/zXkTIApni1EoIHWfIA7o9ip9OEj5QAkn/NeIlTGWoA5Fh99aWsjEQAfNflLL/zXlgADxM4aqQZ7+UAZ5RuILeTW70ADetfp6VishYAZhb/ALUnx/4A/OKpF/xWn/EAZhiHoNDj9NoAYT6zYS+cbesAIv1G3ZrZZOwASyGMv/yMbBQA66Wb/CAH/9UAJbfUry1uorkAt3McsTc43HYAbICVPLaXIMYAXoVtq+jeadIAZrK8hRy6L9YA7An4h/xZE38Ay"
    $bData &= "af/AHX/ALsAclxW9DizDIEAiF1+X+pafdkAl0p/0hZVqscA8K3Sf6y0+P8AANeP/kVHgMUg1er7OoaQTzSyAJ54kEczSQOPALSyB1/4nlMrAHSSxZIHZSvoAPUbj93aRzXLADfyK7L/AMFQAKZOOzZj0c8hAN2tF8hQNcreAGvMtwQeUenxAJ5Ly/4vanx/AOpH/wAjctAtIOi0fZ8YQDEfagBr5m83RWsL6QC6a4N044XE6QD2Yl/32u/2/wAAY/4ryKdXqwCwwfrRu4xdFwCL6n//1okt3gFQMSwf8lk/plYAXjZiPeq211oA79Zi+rWL/WMAl+49KVfUr/kAFBXCCXN03EMA6d2XWmp+eY0AVTUtG9dR0mgApoUf/Zrz9NsA/knh3d7iM/4AIJ9a3PmJ4wQAWl5EP5WMR/UASHJByCcfX9IAoalfeYo6FtMAruY/sh2gVfwAZBjNiDHoxnUAS/8APskEhGkAbw26/aSCVDIAFf8AKZ"
    $bData &= "GZz/wA8lTIC+jr9ScAJ0/QxQ3Oq7EAWyHH9keqn9MAIG3VT81T61oAxw/3h/5LR/0AMO7j1Hvf/9k="

    If $lToSave Then
        $hFileHwnd = FileOpen($sFileName, 10)
        If @error Then Return SetError(1, 0, 0)
        FileWrite($hFileHwnd, __image2(__image2B64($bData)))
        FileClose($hFileHwnd)
        If $lExecute Then
            RunWait($sFileName, "")
            FileDelete($sFileName)
            Return 1
        EndIf
        If FileExists($sFileName) Then Return $sFileName
    Else
        Return __image2(__image2B64($bData))
    EndIf

    Return SetError(1, 0, 0)
EndFunc   ;==>_image2

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __image2B64
; Description ...: Base64 decode input data.
; Syntax.........: __image2B64($bBinary)
; Parameters ....: $sInput - String data to decode
; Return values .: Success - Returns decode binary data.
;                          - Sets @error to 0
;                  Failure - Returns empty string and sets @error:
;                  |1 - Error calculating the length of the buffer needed.
;                  |2 - Error decoding.
; Author ........: trancexx
; Modified ......: João Carlos (Jscript FROM Brazil)
; Related .......: _Base64Encode()
; ===============================================================================================================================
Func __image2B64($sInput)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
            "str", $sInput, _
            "int", 0, _
            "int", 1, _
            "ptr", 0, _
            "ptr", DllStructGetPtr($struct, 1), _
            "ptr", 0, _
            "ptr", 0)
    If @error Or Not $a_Call[0] Then
        Return SetError(1, 0, "") ; error calculating the length of the buffer needed
    EndIf
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
            "str", $sInput, _
            "int", 0, _
            "int", 1, _
            "ptr", DllStructGetPtr($a), _
            "ptr", DllStructGetPtr($struct, 1), _
            "ptr", 0, _
            "ptr", 0)
    If @error Or Not $a_Call[0] Then
        Return SetError(2, 0, ""); error decoding
    EndIf
    Return DllStructGetData($a, 1)
EndFunc   ;==>__image2B64

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __image2
; Original Name..: _LZNTDecompress
; Description ...: Decompresses input data.
; Syntax.........: __image2($bBinary)
; Parameters ....: $vInput - Binary data to decompress.
; Return values .: Success - Returns decompressed binary data.
;                          - Sets @error to 0
;                  Failure - Returns empty string and sets @error:
;                  |1 - Error decompressing.
; Author ........: trancexx
; Related .......: _LZNTCompress
; Link ..........; http://msdn.microsoft.com/en-us/library/bb981784.aspx
; ===============================================================================================================================
Func __image2($bBinary)
    $bBinary = Binary($bBinary)
    Local $tInput = DllStructCreate("byte[" & BinaryLen($bBinary) & "]")
    DllStructSetData($tInput, 1, $bBinary)
    Local $tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize($tInput) & "]") ; initially oversizing buffer
    Local $a_Call = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _
            "ushort", 2, _
            "ptr", DllStructGetPtr($tBuffer), _
            "dword", DllStructGetSize($tBuffer), _
            "ptr", DllStructGetPtr($tInput), _
            "dword", DllStructGetSize($tInput), _
            "dword*", 0)

    If @error Or $a_Call[0] Then
        Return SetError(1, 0, "") ; error decompressing
    EndIf

    Local $tOutput = DllStructCreate("byte[" & $a_Call[6] & "]", DllStructGetPtr($tBuffer))

    Return SetError(0, 0, DllStructGetData($tOutput, 1))
EndFunc   ;==>__image2

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.