[cairo] How to load a BMP/JPG/TGA to a Surface?

John hanscusco at hotmail.com
Wed Nov 21 09:14:19 PST 2012

Jonathan Morton <jonathan.morton <at> movial.com> writes:
> It looks to me as though BLoad has included the BMP header in the
> block of data it loaded.  I would talk to FreeBASIC people about that.
>  - Jonathan Morton

As a FreeBasic user, I can reply to that. FreeBASIC's BLoad does not include the
BMP header, but it prepends its own header, which is either 4 bytes or 32 bytes
(depending on the version resp. the language option you are using; the newer
versions use 32 bytes). This may explain the offset on your image. So try to
find out if your version uses the 4-byte or the 32-byte header, and then start
to read the pixel data after that header.

More information about the cairo mailing list