Jump to content

Bytes To Image


Recommended Posts

I found this >BinaryToAu3Kompressor awhile ago. It still writes to a directory to be loaded and not from the script though.

 

Yes, tested this now:

_MyImage( "arrow.png", @DesktopDir & "\", 0 )

Func _MyImage ( $sFileName, $sOutputDirPath, $iOverWrite=0 )
    Local $sFileBin = "0x89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF610000001974455874536F6674776172650041646F626520496D616765526561647971C9653C000001AF4944415478DAA453BF4BC34014FE52D3A885621D4470E8A2B82A1C0E6E4E227670D241BA38B9F64F707474112C8820C649110771E8E2E024580705051507B75ADA6AFA2BC95D2EDE5D6B8CB582D00F5EDEBDCBBDEFFDBAD37CDF472FD0E5676AF30E9AA6059B899191602DF6B3425D32C64C4629A8E328716D1B0F1B332D824ED4DEDF31188F7F99A42D1266E7D948370219A961594A4B492F8E11A133F0FDF4BF08243CC6E0D4EB2ADD8F0F0FE9549250D7FD45A24A108DCC86D2FC26F13C25B6CD502830ACA6C6C9FEC97DA6DD7833201051C8DACA34A9D518E4BFAFC9B4D640A5E20A120F4F4F14CB0B93E4F0F436205104B2A39645512C3A41745794506D34D1683641451F642612CFAF7D989B4D92DCC563E69B401C328C0812090394FB78B329CA9C83C50CF0C1282C11BDE6704530311AC3D9F94D5E8C772B5C427E3B9BFBF3B20C2DCD93428363622882ABE39C728EF6F79BE126AE73CE7F39CA3AC534AE4BFA0012C3C0CBC151CBD930CC1F53E8062E6A764469127171494BBBA672D643CE7F1278A269F56A35B0CB3B7B2DE768D4ECFA163A61552A61332FDF429FAE9BDDCE6ABDBEC6087AC4A700030056B4E792141E86110000000049454E44AE426082"
    If Not FileExists ( $sOutputDirPath ) Then DirCreate ( $sOutputDirPath )
    If StringRight ( $sOutputDirPath, 1 ) <> '\' Then $sOutputDirPath &= '\'
    Local $sFilePath = $sOutputDirPath & $sFileName
    If FileExists ( $sFilePath ) Then
        If $iOverWrite = 1 Then
            If Not Filedelete ( $sFilePath ) Then Return SetError ( 2, 0, $sFileBin )
        Else
            Return SetError ( 0, 0, $sFileBin )
        EndIf
    EndIf
    Local $hFile = FileOpen ( $sFilePath, 16+2 )
    If $hFile = -1 Then Return SetError ( 3, 0, $sFileBin )
    FileWrite ( $hFile, $sFileBin )
    FileClose ( $hFile )
    Return SetError ( 0, 0, $sFileBin )
EndFunc

How can set this Image directly to a Button Icon?

Without extracting it? ;o

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