Posted 26 September 2014 - 01:42 AM
I'm trying to Create a Little Addon for PaintUtils to load Images Stored in Table (Paste the Paint File and Place lots of {"",} in it)
But I don't know Exatly What've todo in a Litte Part:
How I Do That? Because I want to make some One-File Compressed Programs that have this Little Trouble Here…
Update:
The RAW Image Table Should look:
But I don't know Exatly What've todo in a Litte Part:
local tColourLookup = {}
for n=1,16 do
tColourLookup[ string.byte( "0123456789abcdef",n,n ) ] = 2^(n-1)
end
function loadImageFromTable( imgTable )
if type( imgTable ) ~= "table" then
error( "Expected table", 2 )
end
local tImage = {}
local i = 0
repeat --[[ --Help Start Here--
local tLine = {}
for x=1,???? do
tLine[x] = tColourLookup[ string.byte(sLine,x,x) ] or 0
end
table.insert( tImage, tLine )
sLine = file:read() --Help Ends Here-- ]]--
until i = #imgTable
return tImage
end
return nil
end
How I Do That? Because I want to make some One-File Compressed Programs that have this Little Trouble Here…
Update:
The RAW Image Table Should look:
logoRAW = {
"99 9 11111 eeeee",
" 9 9 1 1 ee",
" 9 9 11111 eeeee",
" 9 9 1 1 e",
" 99999 1 1 eeeee"}
Edited on 25 September 2014 - 11:54 PM