 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
majkinetor
Joined: 24 May 2006 Posts: 4116 Location: Belgrade
|
Posted: Wed Sep 26, 2007 12:34 pm Post subject: |
|
|
Yes, exaclty what GIF makesr do when you optimise the GIF. _________________
 |
|
| Back to top |
|
 |
Wolna/NLI Guest
|
Posted: Thu Oct 23, 2008 4:10 pm Post subject: |
|
|
Hi,
i think this si exactly what iam looking for.
is here something new? plz tell me how i can use a hex code for show pics in the script?
what funktion i need? Or ist there a GUI out for this?
thx |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Oct 23, 2008 5:32 pm Post subject: |
|
|
sry for DP, its me again!
i love the code you post of the first page.
Plt can you say how i can do the same but with ico formats?
cause when i use bmp i have no transparency! |
|
| Back to top |
|
 |
ecksphore
Joined: 21 Nov 2006 Posts: 71
|
Posted: Thu Feb 26, 2009 8:42 am Post subject: |
|
|
I have a bitmap file (46.9k big)
When using this script, I get an error stating that the line is too long. Is there anyway to fix this?
I've already tried :
| Code: |
data =
( join
....
...
}
data = %data%`n
(
...
...
) |
Each section contained no more than 14,000 characters and it still errors out on me.
Please help! |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Feb 26, 2009 8:47 am Post subject: |
|
|
| ecksphore wrote: | | Each section contained no more than 14,000 characters and it still errors out on me. |
declare into a variable without section.
in other words: a single line. |
|
| Back to top |
|
 |
Data_Iven Guest
|
Posted: Thu May 21, 2009 5:46 am Post subject: |
|
|
Hi, I am very worried with this routine below. I have been working on it for many nights, trying to figure out why it runs out of memory.
I think I am doing everything correctly... but cannot say for sure. I have looked at many examples in this thread, and other places... but nothing seems to jump out at me at what I might be missing.
I don't know if there are additional things I need to 'reset' or clear out before the loop restarts...., that might be causing the problem of the script eventually crashing.
Thank you for anyone who can figure this out! This has me really stumped. I am disposing the bitmap, ... however, you'll notice %COUNT_SUM_PDATA% grows over time until the script crashes. I had about 50 decent sized PNG images in the folder, and a crash eventually happens!
You need to run this script, with a_directory_with_some_pngfiles folder in the script directory. I threw about 3 dozen PNG image files that were between 250K-300K in size. The code loop below demonstrates processing of each image, from a file to a bitmap. Extra code comments are below.
| Code: |
; press a to test loop
a::
Loop
{
Gosub, PROCESS_IMAGE
Tooltip, LOOP DONE! <%COUNT_PROCESSED% PROCESSED>
}
Return
; ---------------------------------------------
; ---------------------------------------------
PROCESS_IMAGE:
; ----- setup test variables
COUNT_PROCESSED=0
COUNT_SUM_HDATA=0
COUNT_SUM_PDATA=0
COUNT_SUM_NSIZE=0
; ---------------------------------------------
Loop, a_directory_with_some_pngfiles\*.*
{
FileGetSize, dataSz , a_directory_with_some_pngfiles\%A_LoopFileName%
FileRead, BinData , a_directory_with_some_pngfiles\%A_LoopFileName%
hexData := Bin2Hex( &BinData, dataSz )
; ^ Convert Image To Hex Data
nSize := StrLen(hexData)//2
Hex2Bin(Buffer,hexData)
hData := DllCall("GlobalAlloc", UInt,2, UInt, nSize)
pData := DllCall("GlobalLock", UInt,hData)
DllCall( "RtlMoveMemory", UInt,pData, UInt,&Buffer, UInt,nSize)
DllCall( "GlobalUnlock", UInt,hData)
DllCall( "ole32\CreateStreamOnHGlobal", UInt,hData, Int,True, UIntP,pStream)
DllCall( "LoadLibrary", Str,"gdiplus" )
VarSetCapacity(si, 16, 0), si := Chr(1)
DllCall( "gdiplus\GdiplusStartup", UIntP,pToken, UInt,&si, UInt,0 )
DllCall( "gdiplus\GdipCreateBitmapFromStream", UInt,pStream, UIntP,bitmap)
DllCall(NumGet(NumGet(1*pStream)+8),Uint,pStream)
GDIplus_GetImageDimension(bitmap, WIDTH_OF_IMAGE, HEIGHT_OF_IMAGE)
DllCall( "gdiplus\GdipDisposeImage", UInt,bitmap)
;FileAppend, %COUNT_PROCESSED% - %HDATA% | %PDATA% | %NSIZE% > %WIDTH_OF_IMAGE% x %HEIGHT_OF_IMAGE%`n,TESTING_OUTPUT.TXT
; ^ Uncomment To See Each File Processed - If processing correctly we should see a %WIDTH_OF_IMAGE% x %HEIGHT_OF_IMAGE%
; - end of loop
COUNT_SUM_HDATA:=COUNT_SUM_HDATA+HDATA
COUNT_SUM_PDATA:=COUNT_SUM_PDATA+PDATA
COUNT_SUM_NSIZE:=COUNT_SUM_NSIZE+NSIZE
COUNT_PROCESSED++
}
FileAppend, %COUNT_SUM_HDATA% | > why does this var grow over time, until script crashes? ---> %COUNT_SUM_PDATA% <--- | %COUNT_SUM_NSIZE%`n,TESTING_OUTPUT.TXT
; ^ test output data
return
|
Here are the extra stock functions which make it all work
| Code: |
GDIplus_GetImageDimension(_image, ByRef @imageWidth, ByRef @imageHeight)
{
local r
#GDIplus_lastError =
r := DllCall("GDIplus.dll\GdipGetImageDimension"
, "UInt", _image
, "Float *", @imageWidth
, "Float *", @imageHeight)
If (r != #GDIplusOK)
{
#GDIplus_lastError := "GdipGetImageDimension (" . r . ": " . #GpStatus@%r% . ") " . ErrorLevel
}
@imageWidth := Floor(@imageWidth)
@imageHeight := Floor(@imageHeight)
Return r
}
/*
Bin2Hex() and Hex2Bin()
Machine code functions: Bit Wizardry [ By Laszlo Hars ]
Topic : http://www.autohotkey.com/forum/viewtopic.php?t=21172
Post : http://www.autohotkey.com/forum/viewtopic.php?p=180469#180469
*/
Bin2Hex(addr,len) { ; Bin2HexGOLD(&x,4)
Static fun
If (fun = "")
Hex2Bin(fun,"8B4C2404578B7C241085FF7E2F568B7424108A06C0E8042C0A8AD0C0EA05"
. "2AC2044188018A06240F2C0A8AD0C0EA052AC2410441468801414F75D75EC601005FC3")
VarSetCapacity(hex,2*len+1)
dllcall(&fun, "uint",&hex, "uint",addr, "uint",len, "cdecl")
VarSetCapacity(hex,-1) ; update StrLen
Return hex
}
Hex2Bin(ByRef bin, hex) { ; Hex2Bin(fun,"8B4C24") = MCode(fun,"8B4C24")
Static fun
If (fun = "") {
h:="568b74240c8a164684d2743b578b7c240c538ac2c0e806b109f6e98ac802cac0e104880f8"
. "a164684d2741a8ac2c0e806b309f6eb80e20f02c20ac188078a16474684d275cd5b5f5ec3"
VarSetCapacity(fun,StrLen(h)//2)
Loop % StrLen(h)//2
NumPut("0x" . SubStr(h,2*A_Index-1,2), fun, A_Index-1, "Char")
}
VarSetCapacity(bin,StrLen(hex)//2)
dllcall(&fun, "uint",&bin, "Str",hex, "cdecl")
}
|
|
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 941 Location: The Shell
|
Posted: Fri Aug 07, 2009 7:37 pm Post subject: |
|
|
| Anonymous wrote: | ...declare into a variable without section.
in other words: a single line. |
Had to bump this one.
I too am getting an error message that the line is too long on a single line binary string. It was generated from the converter on the 1st page.
I'm wondering, what is the exact max characters allowed??
Anyone know?
Thanks guys for this amazing (albeit old) work. _________________
 |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 941 Location: The Shell
|
Posted: Sat Aug 15, 2009 3:05 pm Post subject: |
|
|
Did not figure out max characters but did figure out how to breakup and reconstitute illegal binary sets (so you can load unlimited bin strings).
Heres a rudiment label example:
| Code: |
;....................................
definepicture:
picture =
( join
4d5a90000300000004000000ffff0000b800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000e1fba0e00b409cd21b8014ccd21546869732070726f6772616d2063616e6e6f742062652072756e20696e20444f53206d6f64652e0d0d0a2400000000000000504500004c010500e26421440000000000000000e0000f030b010238002a0000003a0000000400002012000000100000004000000000400000100000000200000400000001000000040000000000000000800000000400004a970000030000000000200000100000000010000010000000000000100000000000000000000000007000005c040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e746578740000002428000000100000002a000000040000000000000000000000000000600000602e64617461000000200100000040000000020000002e0000000000000000000000000000400000c02e7264617461000000080000005000000008000000300000000000000000000000000000400000402e6273730000000070020000006000000000000000000000000000000000000000000000800000c02e696461746100005c040000007000000006000000380000000000000000000000000000400000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005589e583ec18895df88b550831db8975fc8b0231f68b003d910000c077433d8d0000c0725bbe01000000c704240800000031c089442404e8c425000083f801746c85c0742ac7042408000000ffd0bbffffffff89d88b75fc8b5df889ec5dc204003d930000c074bd3d940000c074bb89d88b75fc8b5df889ec5dc204008d76003d050000c075e8c704240b00000031f689742404e86725000083f801743485c074cdc704240b000000ffd0eba1c7042408000000bb01000000895c2404e83e25000085f67488e865200000bbffffffffeb81c704240b000000b901000000bbffffffff894c2404e814250000e962ffffffeb0d909090909090909090909090905589e55383ec248d5df8c7042400104000e89a26000083ec04e812200000c745f800000000b8006040008d55f4895c24108b0de04040008944240489542408894c240cc7042404604000e8e1240000a1c061400085c07458a3f04040008b154871400085d20f858b00000083fae07420a1c0614000894424048b1d487140008b4b30890c24e8962400008b154871400083fac0741b8b1dc0614000895c24048b0d487140008b5150891424e870240000e85b2400008b1df04040008918e83e1f000083e4f0e8262400008b08894c24088b150060400089542404a104604000890424e8ee01000089c3e8f2230000891c24e8ca250000894424048b15487140008b4210890424e8152400008b1548714000e955ffffff8d76008dbc27000000005589e583ec08c7042401000000ff153c714000e8c8feffff908db426000000005589e583ec08c7042402000000ff153c714000e8a8feffff908db42600000000558b0d5871400089e55dffe18d742600558b0d4c71400089e55dffe1909090905589e55de977200000909090909090905589e583ec28a1106040003b45080f8d06010000833d1460400000740aa1146040008945fceb45ff0510604000a1106040003b45087c0cc745f400000000e9de000000a1106040008d1485000000008b450c8b04028945fc8b45fc80382d740cc745f400000000e9b50000008d45fcff008b45fc8038000f848e0000008b45fc0fbe00894424048b4510890424e82e2300008945f8837df800742f8b45fca3146040008b45f84080387c75138b45fc40a310624000c70514604000000000008b45fc0fbe008945f4eb57837d1400753b8b45fc8944240c8b450c8b0089442408c744240400504000a14871400083c040890424e8b8220000c7051460400000000000c745f4ffffffffeb16c7051460400000000000e9ecfeffffc745f4000000008b45f4c9c3909090909090909090905589e583ec08a1c0604000890424e82d230000c9c35589e583ec2883e4f0b80000000083c00f83c00fc1e804c1e0048945f48b45f4e846210000e8e11d0000c7053861400001000000c744240c00000000c7442408a55040008b450c894424048b4508890424e865feffff8945fc837dfc000f84bc0000008b55fc428955f8837df87777c48b55f88b04958c514000ffe0a1106240008038007414a110624000890424e888220000a320604000eb9ac7052060400050000000eb8ec7053861400000000000eb82ff0530604000e977ffffffff0540604000e96cffffffc70504404000b4504000c70508404000cd504000c7050c404000e7504000c7051040400004514000c705144040001f514000c7051840400030514000c7051c40400046514000e921ffffffc7042401000000e8ec210000a1106040003b45087d2fc74424045b514000a1106040008d1485000000008b450c8b0402890424ff0510604000e8f6000000a3c0604000eb1dc74424045b514000a1487140008b4010890424e87b200000a3c0604000a1106040003b45087d3ea14871400083c02089442408c74424045e514000a1106040008d1485000000008b450c8b0402890424e84e21000085c0750cc7042460514000e806010000e868090000c705d0604000c0134000c7056060400000000000c7057060400004000000c7059060400060000000c705a060400060000000c705b060400000000000c7058060400000000000e8fe090000a14871400083c0208b400cc1e80583e00185c0740cc7042477514000e895
)
picture2 =
( join
000000a1c0604000890424e8b0200000c7042400000000e8c42000005589e583ec188b450c894424048b4508890424e8dc2000008945fc837dfc0075568b450889442408c74424046c534000a14871400083c040890424e8e41f0000e83f2000008b00890424e84520000089442408c74424048d534000a14871400083c040890424e8b91f0000c7042401000000e84d2000008b45fcc9c35589e583ec18833d00404000007f218b450889442408c7442404a7534000a14871400083c040890424e87a1f0000eb1f8b450889442408c7442404be534000a14871400083c040890424e8591f0000c9c35589e583ec18833d3060400000745a8b4d08b8abaaaa2af7e9d1fa89c8c1f81f29c289d08944240c8b4d08b8abaaaa2af7e9d1fa89c8c1f81f29c289d001c001d0c1e00229c189c88b04852040400089442408c7442404e6534000c7042450604000e8401f0000eb1b8b450889442408c7442404eb534000c7042450604000e8231f0000b850604000c9c35589e583ec188b4510c1e80f83e00185c07441c70540604000000000000fb64510894424108b4510c1f808f7d825ff000000f7d88944240c8b450c894424088b450889442404c70424ee534000e8ba1e0000eb218b45108944240c8b450c894424088b450889442404c7042401544000e8971e0000837d08027e2b8b450889442408c744240414544000a14871400083c040890424e8321e0000c7042401000000e8c61e00008b4510a3a0604000a3906040008b450ca300404000c9c35589e583ec08c7042435544000e83d1e0000ff0560604000c9c35589e583ec08c704243b544000e8231e0000ff0d00404000c9c35589e583ec18e8320400008b450c890424e86efeffff89c28b45108944240c895424088b45084089442404a104404000890424e8e31d0000c9c35589e583ec18e8f80300008b450c890424e834feffff89c28b45108944240c895424088b45084089442404a108404000890424e8a91d0000c9c35589e583ec18e8be0300008b450c890424e8fafdffff89c28b45108944240c895424088b45084089442404a10c404000890424e86f1d0000c9c35589e583ec18e8840300008b45108944240c8b450c894424088b45084089442404a110404000890424e83f1d0000c9c35589e583ec18e8540300008b4510c1e00703450c894424088b45084089442404a114404000890424e8101d0000c9c35589e583ec18e8250300008b450c894424088b45084089442404a118404000890424e8e71c0000c9c35589e583ec18e8fc0200008b450c894424088b45084089442404a11c404000890424e8be1c0000c9c35589e583ec08e8d3020000c7042443544000e8a51c00008b4508894424048b450c890424e88f040000c9c35589e583ec08e8a80200008b450889442404c7042449544000e8731c00008b450c894424048b4510890424e85d040000c9c35589e583ec08e876020000c7042455544000e8481c00008b4508894424048b450c890424e832040000c9c35589e583ec18c745fc08000000e844020000837d08007e0a8b45083b45fc7f02eb158b450889442404c7042495544000e8ff1b0000eb37837d08037517833d6060400001750ec70424a2544000e8e21b0000eb1a8b45088b04856040400089442404c70424b0544000e8c61b00008b450c894424048b4510890424e85b020000c9c35589e583ec08e8c90100008b450889442404c70424b9544000e8941b0000c9c35589e583ec08e8a9010000c70424c3544000e87b1b0000c9c35589e583ec18e890010000837d0c007409c745fcd0544000eb07c745fcd65440008b45fc894424088b45088945f8837d087f7e0b8b45f82d000100008945f88b45f889442404c70424dc544000e8271b0000c9c35589e583ec08e83c0100008b450889442404c70424ea544000e8071b0000c9c35589e583ec28c745fc010000008b550c8d450cff0885d27e0a8b45fc01c08945fcebeae8ff0000008b4514894424108b45108944240c8b45fc894424088b450889442404c70424f5544000e8b51a00008b15b0604000a13c61400029d089c2a1906040000faf05706040008945f889d099f77df88945f88b4df8010d80604000a13c614000a3b06040008b4508a370604000a1a06040008d1485000000008d45fc8945f889d08b4df899f7398945f88b45f8a390604000c9c35589e583ec18e8630000008b4518894424148b4514894424108b45108944240c8b450c894424088b450889442404c704240a554000e8121a0000c9c35589e583ec08e8270000008b450889442404c7042420554000e8f21900008b4508894424048b450c890424e8dc010000c9c35589e583ec18833d4060400000745f8b15b0604000a13c61400029d099f73d906040008945fc8b15b0604000a13c61400029d099f73d906040008954240c8b45fc99f73d70604000895424088b45fc99f73d7060400003058060400089442404c7042424554000e872190000eb15a13c61400089442404c7042431554000e85b190000c9c35589e583ec18c745f419000000c7042436554000e840190000c745fc000000008b45fc3b450c0f8d1b0100008b45080fb6008945f8ff4508833d2060400000743d8b45f43b05206040007c32c7042438554000e801190000c745f40d000000837df8207408837df8097402eb11c704245c000000e8d01800008d45f4ff008b45f88945f0837df00d743d837df00d7f0e837df0007459837df00a743feb65837df0227408837df05c7402eb578b45f889442404c704243c554000e89a1800008d45f4830002eb76c7042440554000e8861800008d45f4830002eb62c7042443554000e8721800008d45f4830002eb4ec7042446554000e85e1800008d45f4830002eb3a8b45f8890424e82b18000085c074128b45f8890424e82c1800008d45f4ff00eb198b45f889442404c7042449554000e8221800008d45f48300048d45fcff00e9d9feffffc7042450554000e806180000c9c35589e583ec18c745f819000000c745fc000000008b45fc3b450c7d59833d2060400000742a8b45f83b05206040007c1f8b45080fb60089442404c7042453554000e8be170000c745f80e000000eb1c8b45080fb60089442404c704245b554000e89f1700008d45f88300038d45fcff00ff4508eb9fc7042461554000e883170000c9c35589e5c705d460400098164000c705d860400074174000c705dc60400031184000c705e06040004b184000c705e460400065184000c705e86040009f184000c705ec604000d9184000c705f060400013194000c705f460400043194000c705f860400072194000c705fc6040009b194000c70500614000c4194000c70508614000ef194000c7050c614000ce1a4000c70510614000ee1a4000c7051c6140007b1b4000c70514614000341c4000c705186140005b1b4000c70520614000071b4000c70524614000211a4000c705286140004c1a4000c70504614000701c40005dc35589e583ec08833dd060400000750cc7042470554000e8a8090000e8be000000e82a01000085c07402ebf5c9c35589e583ec08e8c8ffffffc9c35589e583ec48c745f4000000008b45088945f08b55f48d45f4ff0083fa037f52a1d0604000ffd08945ec837decff74428b45f00fbe108d45f0ff003b55ec74d3c7442404985540008d45c8890424e8131700008b4508894424048d45c8890424e8f11600008d45c8890424e819090000eba18b45ecc9c35589e583ec08a1d0604000ffd08945fc837dfcff750cc70424a3554000e8f0080000ff0d486140008b45fcc9c35589e583ec18c70424b1554000e84affffff83f8ff7502eb56e855080000a348614000e8930800008945fce88b0800008945f8e8830800008945f4833dd860400000741b8b45f4894424088b45f8894424048b45fc890424a1d8604000ffd0833d48614000007e07e866ffffffebf0c9c35589e55383ec44c745e800000000c745e400000000c745e000000000c70424b6554000e8c3feffff83f8ff750cc745d800000000e9a4020000e8c4070000a348614000c7053c61400000000000833ddc604000007407a1dc604000ffd0833d48614000000f8e5c020000e8db06000001053c614000e8e8feffff8945f4837de8007415817df4f7000000740cc70424bc554000e8dc0700008b45f4c1e80783f00183e00185c07427837de000750cc70424e9554000e8ba070000c745e4010000008b45f48945f08b45e08945f4eb16817df4ef0000007f0d8b45f48945e0c745e4000000008b45f4c1f80483e00f8b0485a04040008945dc837ddc007443837de4007508e859feffff8945f0837ddc017e0ae84bfeffff8945d4eb07c745d4000000008b45d4894424088b45f0894424048b45e0890424e85d040000e91cffffff8b45f48945d0817dd0f70000000f84d6000000817dd0f70000007f0e817dd0f0000000745ae94b010000817dd0ff0000007405e93d010000e8e4fdffff8945ece8c405000089c2a14861400029d08945f8e805070000a1486140003b45f87e0fe8bcfdffff890424e811070000ebe78b45ec890424e858010000e99dfeffffe8850500008b154861400029c289d08945f8e8c5060000c70424f0000000e8dc060000a1486140003b45f87e15e870fdffff8945f48b45f4890424e8bf060000ebe1817df4f70000007409833d3861400000750ae850030000e93ffeffffc745e801000000e933feffffe81b0500008b154861400029c289d08945f8837de8007505e855060000a1486140003b45f87e15e80cfdffff8945f48b45f4890424e85b060000ebe1837de800752c833d04614000000f84e4fdffffe82d06000089c3e830060000895c2404890424a104614000ffd0e9c5fdffff817df4f70000000f85b8fdffffe8bf020000c745e800000000e9a7fdffff8b45f4890424e825000000e997fdffff833de0604000007407a1e0604000ffd0c745d8010000008b45d883c4445b5dc35589e583ec388b450889442408c7442404035640008d45d8890424e85b1200008d45d8890424e863050000c9c35589e583ec28e8970500008945fce8850500008945f88b45088945f4837df4510f84e3000000837df4517f2a837df40f7f15837df4010f8d87000000837df400744ce9e9010000837df42f0f849f000000e9da010000837df4580f8447010000837df4587f0f837df4540f84e3000000e9bb010000837df4590f846c010000837df47f0f8488010000e9a2010000833d0c614000000f84b90100008b45f8400fbe00894424048b45f80fbe00890424e829040000890424a10c614000ffd0e991010000833d28614000000f84840100008b45f8894424088b45fc894424048b4508890424a128614000ffd0e964010000833d10614000000f8457010000a110614000ffd0e94b010000833d18614000000f843e0100008b45f883c0020fbe008944240c8b45f8400fbe00894424088b45f80fbe0089442404c7042400000000e84a030000890424a118614000ffd0e901010000833d14614000000f84f40000008b45f883c0040fbe00894424108b45f883c0030fbe008944240c8b45f883c0020fbe00894424088b45f8400fbe00894424048b45f80fbe00890424a114614000ffd0e9ad000000833d1c614000000f84a00000008b45f883c0030fbe008944240c8b45f883c0020fbe00894424088b45f8400fbe00894424048b45f80fbe00890424a11c614000ffd0eb69833d206140000074608b45f8400fbe00894424048b45f80fbe00890424a120614000ffd0eb43833d2461400000743a8b45f8894424048b45fc890424a124614000ffd0eb24833d0861400000741b8b45f8894424088b45fc894424048b4508890424a108614000ffd0c9c35589e55383ec14833d0061400000741ae82d03000089c3e830030000895c2404890424a100614000ffd083c4145b5dc35589e583ec188b450883e00f8945fc8b450825f00000008945f8817df8b00000000f8400010000817df8b00000007f36817df8900000000f8490000000817df8900000007f0e817df8800000007451e95b010000817df8a00000000f8499000000e949010000817df8d00000000f841f010000817df8d00000007f12817df8c00000000f84ea000000e921010000817df8e00000000f84b2000000e90f010000833de8604000000f84020100008b4510894424088b450c894424048b45fc890424a1e8604000ffd0e9e2000000833de4604000000f84d50000008b4510894424088b450c894424048b45fc890424a1e4604000ffd0e9b5000000833dec604000000f84a80000008b4510894424088b450c894424048b45fc890424a1ec604000ffd0e988000000833df060400000747f8b4510894424088b450c894424048b45fc890424a1f0604000ffd0eb62833df46040000074598b4510894424088b450c894424048b45fc890424a1f4604000ffd0eb3c833df86040000074338b450c894424048b45fc890424a1f8604000ffd0eb1d833dfc6040000074148b450c894424048b45fc890424a1fc604000ffd0c9c35589e583ec08e80df8ffff8945f88b45f88945fc8b45f8c1e80783e00185c074318d45fc83207fe8ecf7ffff8945f88b45fc89c2c1e2078b45f883e07f8d04028945fc8b45f8c1e80783e00185c07402ebd58b45fcc9c35589e583ec04c745fc000000000fb645088945fc8b45fc89c2c1e2080fb6450c8d04028945fc8b45fc89c2c1e2080fb645108d04028945fc8b45fc89c2c1e2080fb645148d04028945fc8b45fcc9c35589e50fb64508c1e0080fb6550c01d05dc35589e583ec28e855f7ffff8945fce84df7ffff8945f8e845f7ffff8945f4e83df7ffff8945f08b45f08944240c8b45f4894424088b45f8894424048b45fc890424e859ffffffc9c35589e583ec18e80df7ffff8945fce805f7ffff8945f88b45f8894424048b45fc890424e87effffffc9c35589e583ec08833dd460400000740d8b4508890424a1d4604000ffd0c7042401000000e8150d00005589e5c70588614000000000005dc35589e5a1686140005dc35589e5a1886140005dc35589e583ec08a1886140003b05786140007c
)
picture3 =
( join
05e81a000000a18861400089c20315686140008b45088802ff0588614000c9c35589e583ec28a1686140008945f8a1786140008945f4832d7861400080a178614000890424e8160d00008945fc837dfc00750cc704241b564000e844ffffff837df800743d8b45fc8945f08b55f88955ec8b45f48b55f801c28955e88b45e83945ec74138b55ec0fb6028b55f08802ff45f0ff45ecebe58b45f8890424e8ae0c00008b45fca368614000c9c35589e583ec18833d2c61400000750cc704242c564000e8dcfeffff833d3061400000750cc7042458564000e8c7feffff8b4510894424088b450c894424048b4508890424e87d010000837d0801752a833d34614000007421a134614000894424088b451489442404c70424ffffffffe8380000008d450cff08c745fc000000008b45fc3b450c7d22a130614000894424088b4514894424048b45fc890424e8090000008d45fcff00ebd6c9c35589e583ec28c745fc6b72544dc745f8000000008b450c890424e8c90b00008945f48b45fc890424e8a50400008b45f8890424e89a040000c7055861400000000000c70598614000000000008b45088904248b4510ffd0813d98614000ff000000750b833da86140002f7502eb30c7042400000000e8cc040000c70424ff000000e8c0040000c704242f000000e8b4040000c7042400000000e8a8040000c70598614000000000008b450c890424e8350b00008945f0c7442408000000008b45f4894424048b450c890424e8080b000085c0790cc7042490564000e86bfdffffa1586140008945f88b45fc890424e8df0300008b45f8890424e8d4030000c7442408000000008b45f0894424048b450c890424e8c00a0000c9c35589e583ec18c745fc6468544dc745f8060000008b45fc890424e8990300008b45f8890424e88e0300008b4508890424e8d00300008b450c890424e8c50300008b4510890424e8ba030000c9c35589e583ec188b4508890424e8580200008b550c8b451008d08845fb837d100f760cc70424bc564000e8330a0000833d4061400000740e0fb645fb3b05986140007502eb0c0fb645fb890424e88e0300000fb645fba398614000c745fc000000008b45fc3b451873188b45140345fc0fb600890424e8650300008d45fcff00ebe08b4518c9c35589e583ec188b450c8845ff8b4508890424e8cc010000c70424ff000000e836030000c70598614000ff0000000fb645ff890424e8200300000fb645ffa3a86140008b4514890424e896010000c745f8000000008b45f83b451473308b45100345f80fb600890424e8ec02000089c28b45100345f80fb60039c27409c745f4ffffffffeb0d8d45f8ff00ebc88b45148945f48b45f4c9c35589e583ec188b4508890424e83b0100008b450c0fb600890424e8a3020000c70598614000000000008b451048890424e817010000c745fc010000008b45fc3b451073308b450c0345fc0fb600890424e86d02000089c28b450c0345fc0fb60039c27409c745f8ffffffffeb0d8d45fcff00ebc88b45108945f88b45f8c9c35589e583ec088b4508890424e8bc000000c70424ff000000e826020000c70598614000ff000000c7042451000000e810020000c7042403000000e8040200008b450cc1e81025ff000000890424e8f10100008b450cc1e80825ff000000890424e8de0100000fb6450c890424e8d2010000c9c35589e583ec10dd4508d95dfc8b45fc8945f8d945f8dd05e8564000dec9dd05f0564000def9db4510dec98b4514ba000000005250df2c248d642408def9d97df60fb745f6660d000c668945f4d96df4db5df0d96df68b45f0c9c35589e583ec088b450883e07f8945fcc16d08078b450885c0741c8d45fcc120088d45fc8108800000008b550883e27f8d45fc0110ebd90fb645fc890424e8340100008b45fcc1e80783e00185c074088d45fcc12808ebdfc9c35589e583ec10837d0c007e3c8b4508ba000000005250df2c248d6424088b4510ba000000005250df2c248d642408dec9db450cdd05f8564000dec9def9d95df48b45f48945f0eb5c8b450c2500ff0000c1f808660fb6c06650df04248d642402d95dfc8b550cb0ff20d0660fb6c06650df04248d642402d95df88b4508ba000000005250df2c248d642408d945fcd84df8dd05f8564000dec9def9d95df48b45f48945f0d945f0c9c35589e583ec088b4508c1e81825ff000000890424e85b0000008b4508c1e81025ff000000890424e8480000008b4508c1e80825ff000000890424e8350000000fb64508890424e829000000c9c35589e583ec088b45082500ff0000c1f808890424e80e0000000fb64508890424e802000000c9c35589e583ec188b45088845ff833d2c614000007515c7042400574000e8e4f8ffffc745f4ffffffffeb2f0fb645ff890424a12c614000ffd08945f8837df8ff750cc7042412574000e8b8f8ffffff05586140008b45f88945f48b45f4c9c39090909055b90058400089e5eb148db6000000008b51048b0183c10801820000400081f90058400072ea5dc390909090909090905589e5dbe35dc39090909090909090905589e583ec08a1004140008b0885c97426eb0d90909090909090909090909090ff108b0d004140008b51048d4104a30041400085d275e9c9c38db426000000005589e55383ec04a11038400083f8ff742985c089c3741389f68dbc2700000000ff149d103840004b75f6c7042440314000e8aae0ffff5b5b5dc38b0d1438400031c085c9eb0a408b14851438400085d275f4ebbd8db6000000008dbf000000005589e55383ec04a1d061400085c07536a110384000bb01000000891dd061400083f8ff742585c089c3740f908d742600ff149d103840004b75f6c7042440314000e83ae0ffff5b5b5dc38b0d1438400031c085c9eb0a408b14851438400085d275f4ebc190909090909090909090909055a13062400089e55d8b4804ffe189f655ba4200000089e5530fb7c083ec64895424088d55a831db89542404890424ff1514714000ba1f000000b90100000083ec0c85c07507eb4601c94a780e807c2aa84175f409cb01c94a79f2833b3c750789d88b5dfcc9c3b944574000baea000000894c240c89542408c7042471574000b89057400089442404e892020000b8bc574000bbe40000008944240c895c2408ebd78db426000000008dbc27000000005589e557565381eccc0000008b0d3062400085c974088d65f45b5e5f5dc3c7459841414141a1205740008d7598c7459c41414141c745a0414141418945b8a124574000c745a441414141c745a8414141418945bca128574000c745ac41414141c745b0414141418945c0a12c574000c745b4414141418945c4a1305740008945c8a1345740008945cca1385740008945d0a13c5740008945d40fb70540574000668945d8893424ff15107140000fb7c083ec0485c0898544ffffff0f853b010000c704243c000000e89303000085c089c30f8459010000fc89c78b8544ffffffb90f000000f3abc7430490374000b901000000c7430850324000a1f0614000c7033c0000008b15f4614000c7432800000000894314a1104140008953188b151441400089431ca100624000895320c74330ffffffff89432c8b151c414000a118414000895338ba1f00000089433489f689d821c883f80119c0242001c9044188842a48ffffff4a79e7a120574000898568ffffffa12457400089856cffffffa128574000898570ffffffa12c574000898574ffffffa130574000898578ffffffa13457400089857cffffffa138574000894580a13c5740008945840fb70540574000668945888d8548ffffff890424ff15087140000fb7f883ec0485ff754231d285d2751e891c24e863020000893424ff151071400083ec040fb7c0e85ffdffff89c3891d306240008d4304a3206240008d4308a3406240008d65f45b5e5f5dc389f8e838fdffff39d889fa75b1ebb1e85b02000090909090909090909090905189e183c1083d00100000721081e9001000008309002d00100000ebe929c183090089e089cc8b088b4004ffe09090905589e583ec188b4514894424108b45108944240c8b450c894424088b450889442404a14871400083c040890424e89e000000a14871400083c040890424e8ee010000e8d9010000909090909090909090ff252471400090900000000000000000ff253c71400090900000000000000000ff254071400090900000000000000000ff253471400090900000000000000000ff259c71400090900000000000000000ff253871400090900000000000000000ff255071400090900000000000000000ff253071400090900000000000000000ff257071400090900000000000000000ff25a871400090900000000000000000ff258871400090900000000000000000ff259871400090900000000000000000ff259471400090900000000000000000ff25a071400090900000000000000000ff254471400090900000000000000000ff25b071400090900000000000000000ff256471400090900000000000000000ff257871400090900000000000000000ff256071400090900000000000000000ff255c71400090900000000000000000ff258471400090900000000000000000ff256c71400090900000000000000000ff259071400090900000000000000000ff257c71400090900000000000000000ff258071400090900000000000000000ff257471400090900000000000000000ff258c71400090900000000000000000ff25a471400090900000000000000000ff25ac71400090900000000000000000ff255471400090900000000000000000ff256871400090900000000000000000ff251871400090900000000000000000ff250c71400090900000000000000000ff251471400090900000000000000000ff251071400090900000000000000000ff250871400090900000000000000000
)
picture4 =
( join
5589e55de977daffff90909090909090ffffffff0038400000000000ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000002050400034504000495040005f504000745040008350400094504000c9534000cb534000ce534000d0534000d3534000d5534000d7534000da534000dc534000df534000e1534000e453400000000000000000000000000000000000000000005d544000625440006c544000745440007e544000845440008b5440008f5440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000002000000020000000200000001000000010000000200000000000000ffffffff000000000000000000000000004000000000000000000000000000002038400000000000000000000000000000000000ffffffff00000000ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025733a206e6f207375636820666c61673a2025730a00000000000000000000004f6e2063683d2564206e3d257320763d25640a004f66662063683d2564206e3d257320763d25640a00506f50722063683d2564206e3d257320763d25640a005061722063683d256420633d256420763d25640a0050622063683d256420763d25640a00507243682063683d256420703d25640a00436850722063683d256420763d25640a00467c667c42624e6e547456764d6d004f6e2063683d2564206e6f74653d257320766f6c3d25640a004f66662063683d2564206e6f74653d257320766f6c3d25640a00506f6c7950722063683d2564206e6f74653d25732076616c3d25640a00506172616d2063683d256420636f6e3d25642076616c3d25640a0050622063683d25642076616c3d25640a0050726f6743682063683d25642070726f673d25640a004368616e50722063683d25642076616c3d25640a00726200770043616e2774206f70656e206f75747075742066696c65004f75747075742066696c65206572726f7200000000e814400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400092144000091440000914400009144000511440000914400009144000091440000914400009144000091440007b14400087144000091440000914400009144000091440000914400092144000091440009d144000091440000914400009144000091440000914400009144000091440000914400009144000091440000914400092144000091440000914400009144000511440000914400009144000091440000914400009144000091440007b14400087144000091440000914400009144000091440000914400092144000091440009d1440002a2a2a204552524f52202a2a2a2043616e6e6f74206f70656e2027257327210a002a2a2a2a2a2a2a2a2a2a2a2a2a20526561736f6e3a2025730a004572726f723a204761726261676520617420656e640a004572726f723a2025730a00630063230064006423006500660066230067006723006100612300620025732564002564004d46696c652025642025642025642025640a004d46696c652025642025642025640a0000000043616e2774206465616c207769746820666f726d61742025642066696c65730a004d54726b0a0054726b456e640a005379734578004d657461203078253032780053657153706563005465787400436f707972696768740054726b4e616d6500496e7374724e616d65004c79726963004d61726b65720043756500556e726563004d6574612030782530327820004d657461205365714e616d6520004d65746120257320005365714e722025640a004d6574612054726b456e640a006d696e6f72006d616a6f72004b65795369672025642025730a0054656d706f20256c640a0054696d655369672025642f25642025642025640a00534d5054452025642025642025642025642025640a0041726200256c643a256c643a256c642000256c64200022005c0a09005c2563005c72005c6e005c30005c782530327800220a005c0a0925303278002025303278000a00000000000000000000000000006d667265616428292063616c6c656420776974686f75742073657474696e67204d665f6765746300657870656374696e6720007072656d617475726520454f46004d546864004d54726b00006469646e27742066696e6420657870656374656420636f6e74696e756174696f6e206f66206120737973657800756e65787065637465642072756e6e696e672073746174757300756e657870656374656420627974653a20307825303278006d616c6c6f63206572726f7221000000006d666d665f777269746528292063616c6c656420776974686f75742073657474696e67204d665f70757463006d666d665f777269746528292063616c6c656420776974686f75742073657474696e67204d665f6d665f7772697465747261636b000000006572726f72207365656b696e6720647572696e672066696e616c207374616765206f662077726974650000006572726f723a204d494449206368616e6e656c2067726561746572207468616e2031360a00000000000000000000000000408f4000000000000010400000000080842e414d665f7075746320756e646566696e6564006572726f722077726974696e67002d4c49424743435733322d45482d322d534a4c4a2d475448522d4d494e475733320000007733325f7368617265647074722d3e73697a65203d3d2073697a656f66285733325f45485f534841524544290025733a25753a206661696c656420617373657274696f6e20602573270a00002e2e2f2e2e2f6763632f6763632f636f6e6669672f693338362f7733322d7368617265642d7074722e63000047657441746f6d4e616d6541202861746f6d2c20732c2073697a656f662873292920213d2030000000000000000000000000000000000000000000000000000000000000547000000000000000000000ac73000008710000707000000000000000000000c0730000247100007c70000000000000000000005074000030710000000000000000000000000000000000000000000000000000b8710000c4710000d4710000e0710000f071000000000000000000001072000000000000000000001c7200002c7200003c7200004c720000607200006c72000078720000807200008c72000098720000a0720000ac720000b4720000bc720000c8720000d4720000dc720000e8720000f0720000fc720000047300000c73000014730000207300002c7300003873000044730000507300005c7300006873000074730000807300008c7300000000000000000000b8710000c4710000d4710000e0710000f071000000000000000000001072000000000000000000001c7200002c7200003c7200004c720000607200006c72000078720000807200008c72000098720000a0720000ac720000b4720000bc720000c8720000d4720000dc720000e8720000f0720000fc720000047300000c73000014730000207300002c7300003873000044730000507300005c7300006873000074730000807300008c73000000000000010041646441746f6d4100009b004578697450726f63657373000000af0046696e6441746f6d4100dc0047657441746f6d4e616d65410000df02536574556e68616e646c6564457863657074696f6e46696c74657200000018005f66646f70656e00000027005f5f6765746d61696e61726773003c005f5f705f5f656e7669726f6e00003e005f5f705f5f666d6f64650000000050005f5f7365745f6170705f747970650000000079005f63657869740000000098005f6572726e6f00000000e9005f696f6200005e015f6f6e6578697400000084015f7365746d6f64650000150261626f7274001c02617465786974000000001e0261746f6900002a026578697400002d0266636c6f736500000000300266666c757368000000003802666f70656e003902667072696e74660000003f0266726565000040026672656f70656e0000004302667365656b0045026674656c6c004902676574630000580269737072696e7400000072026d616c6c6f63000000007d02706572726f72000000007f027072696e74660000000081027075746368617200000090027369676e616c000000009302737072696e74660000009702737472636174000000009802737472636872000000009b02737472637079000000009d027374726572726f72000000700000007000000070000000700000007000004b45524e454c33322e646c6c00000000147000006d73766372742e646c6c00002870000028700000287000002870000028700000287000002870000028700000287000002870000028700000287000002870000028700000287000002870000028700000287000002870000028700000287000002870000028700000287000002870000028700000287000002870000028700000287000002870000028700000287000006d73766372742e646c6c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
)
; and the punch line concater is...
picture .= picture2 . picture3 . picture4
Return |
So now just have to make an auto break'er .
Again if anyone knows the max lengths I'm more than open for the actual integer.
edit ok so it looks like 16,384 is the break point .. Breaker breaker on its way now.... _________________
 |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 941 Location: The Shell
|
Posted: Sat Aug 15, 2009 11:18 pm Post subject: |
|
|
Ok I had a chance to put together a continuation section concatenater that works around the binary character limitation.
1st off I found out that each continuation section can contain 16371 characters max not 16383 as stated in the manual (not sure if this is a bug, something to do with a join continuation or the number needs to be changed in the manual).
This section of code creates the template script "NewBinaryFile.ahk" in its working directory. This is just a proof of concept version. Once I confirm everything is working I will add this to an updated version of BMP to Binary.
| Code: | fileExt = jpg
fileName = Test
outputFile = %A_WorkingDir%\NewBinaryFile.ahk
mxLen := 16371
FileDelete, %outputFile%
FileRead, bindat, %A_WorkingDir%\bindat.txt
StringLen, bindatLen, bindat
brkCount := Round(bindatLen /= mxLen)
if brkCount = 0
brkCount = 1
Loop, %brkCount%
{
StringLeft, curBin, bindat, %mxLen%
newBinBrk := "binaryData" A_index " =`n( join`n" curBin "`n)`n`n"
FileAppend, %newBinBrk%, %outputFile%
StringReplace, bindat, bindat, %curBin%,,
contSects .= "binaryData" A_index " . "
}
StringTrimRight, contSects, contSects, 3
contSects := "binData .= " contSects "`n`nReturn`n`ncloseOut:`nMsgbox, Conversion Complete!`nExitApp"
FileAppend, %contSects%, %outputFile%
FileRead, newBinDat, %outputFile%
FileDelete, %outputFile%
writeSect .= "fileLoc = " "%A_WorkingDir%\" fileName "." fileExt "`ngosub, defineFile`nWriteFile(fileLoc,binData)"
prependDat =
(
#SingleInstance Force
#NoEnv
OnExit, closeOut
%writeSect%
; CODE STARTS HERE
; CODE ENDS HERE
; Binary file conversion thanks to Veovis, Laszlo, PhiLho and I'm sure SKAN had something to do with it ;).
; Found here: http://www.autohotkey.com/forum/viewtopic.php?t=10957
WriteFile(file,data)
{
Handle := DllCall("CreateFile","str",file,"Uint",0x40000000
,"Uint",0,"UInt",0,"UInt",4,"Uint",0,"UInt",0)
Loop
{
if strlen(data) = 0
break
StringLeft, Hex, data, 2
StringTrimLeft, data, data, 2
Hex = 0x`%Hex`%
DllCall("WriteFile","UInt", Handle,"UChar *", Hex
,"UInt",1,"UInt *",UnusedVariable,"UInt",0)
}
DllCall("CloseHandle", "Uint", Handle)
return
}
defineFile:
)
FileAppend ,%prependDat%`n%newBinDat%, %outputFile%
Exitapp |
NewBinaryFile.ahk then reads the bindat.txt created from a mod'd version of BMP to Binary found on the 1st page of this thread). It can then be used as a template script that converts the binary to images and joins sections over the max char limt that can be used in a script. Simply edit NewBinaryFile.ahk to see how many sections are created and add your code to this section:
| Quote: | ; CODE STARTS HERE
; CODE ENDS HERE |
For this example save bindat.txt to the same directory as NewBinaryFile.ahk
http://bdm08.zxq.net/bindat.txt
or
http://a.imagehost.org/download/0636/bindat.txt
When there are many continuation sections the conversion process is quite slow but it does work!
I'm going to integrate this into a mod'd version of BMP to Binary converter that will automatically create the script template. That way there will be no need for the external bindat.txt file.
Soon to come...
BTW just noticed that long binary sections actually break the forum (turns a post into blank). So the next question is what the max line length in a single post admins ?  _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|