Picture binary representation


Is the picture binary format documented somewhere?
I have a image representation in another programming language that follows a simple format, and would like to convert that to a MemoryBlock so that I can convert it to a Xojo picture.
The binary format of a picture in that other programming language is:

So, very easy, but I can’t seem to find any info on the Xojo Picture class. I read this page: Picture.FromData and the Picture class documentation. But I cannot find the binary format.

Am I missing something obvious?

Thanks a bunch for insights!!

Xojo supports a few standard picture formats. Picture.FromData is likely only able to handle picture data generated by Picture.GetData, there isn’t much more in the documentation to suggest otherwise.

If your other tool supports standard formats like JPEG or PNG, I would use those.

However, if not, it looks like you have enough information to reconstruct the image using RGB surface.

Thanks a bunch Tim, you have no idea how much you’ve helped me with just saying “RGBsuface”. This is exactly what I need.
To go over your post:

I know, I just wanted to know if I also could assemble the information in such a way that FromData could handle it.

Indeed, I would too. But this is no option.

This is good. I can create a picture with the right height and width, and iterate over all pixels to set the right RGBA values.


Picture.FromData can read whatever formats Picture.Open can read.

This varies by platform (see http://documentation.xojo.com/index.php/Picture.IsImportFormatSupported)

If you mean Mac Pict format there is some info in bottom links here: http://fileformats.archiveteam.org/wiki/PICT

I think, this contains the info was looking for: http://show.docjava.com/posterous/file/2012/07/9614410-DOC01.PDF