Look into
make image from memblock.
The basic structure of a image memblock is as follows:
Offset |Type | Description
-----------|------|-----------------------------
0 |DWORD |Width of the image (in pixels)
4 |DWORD |Height of the image (in pixels)
8 |DWORD |Bit depth (most always you want to set this to 32)
-----------|------|-----------------------------
12+(p*4)+0 |BYTE |Alpha component of pixel p
12+(p*4)+1 |BYTE |Red component of pixel p
12+(p*4)+2 |BYTE |Green component of pixel p
12+(p*4)+3 |BYTE |Blue component of pixel p
Note that the above assumes a bit depth of 32 (meaning one byte per channel). The header size (first section) is 12 bytes.
"Why do programmers get Halloween and Christmas mixed up?" Because Oct(31) = Dec(25)