how to build long strings:
Code: Select all
s .= "long.."
s .= "long.."
s .= "long.."
...
cut up the base64 encoded image in ur editor or use a script to do it for u, ex:
Code: Select all
#NoEnv
#SingleInstance Force
SetBatchLines -1
isUnicode := A_IsUnicode ? 2 : 1
img64 := Clipboard
len := StrLen(img64)
MAX_CHARS := 16000
VarSetCapacity(out, len * A_IsUnicode + 20000)
out := "makeImgStr(ByRef s) {`n`tVarSetCapacity(s, " len " * A_IsUnicode ? 2 : 1)`n`n"
Loop % len / MAX_CHARS
{
i := A_Index - 1
offset := i * MAX_CHARS * isUnicode
out .= "`ts .= """ StrGet(&img64 + offset, MAX_CHARS) """`n"
}
out .= "`ts .= """ StrGet(&img64 + (++i * MAX_CHARS * isUnicode)) """`n`n"
out .= "`treturn s`n}"
Clipboard := out
ExitApp
copy base64, run script, a function will appear in ur
Clipboard, paste it in a new file,
#Include it in ur main script, call
makeImgStr(my_var_name) in ur main script, dont forget to clear the var when ure finally done with it