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

Mj Mendoza IV mjmendoza at konsolscript.org
Tue Jun 1 01:31:17 PDT 2010


Possibly. Though, I'm not quite sure about it since FreeBASIC renders the loaded BMP correctly.

Here's the link to FreeBASIC's sour code for the BLOAD functionality:
https://fbc.svn.sourceforge.net/svnroot/fbc/trunk/FreeBASIC/src/gfxlib2/libfb_gfx_bload.c

The function 'load_bmp' is on line 185. Maybe you could help find the bug, if there is.

Right now, I'm really hoping for unofficial patch:
* cairo_image_surface_create_from_bmp
* cairo_image_surface_create_from_jpg
* cairo_image_surface_create_from_tga

to make it easier for me and others to load images on Cairo Surface.

Regards.

Mj Mendoza IV,
Developer, KonsolScript
http://www.konsolscript.org




________________________________
From: Jonathan Morton <jonathan.morton at movial.com>
To: Mj Mendoza IV <mjmendoza at konsolscript.org>
Cc: Cairo Graphics <cairo at cairographics.org>
Sent: Tuesday, June 1, 2010 1:29:48 PM
Subject: Re: [cairo] How to load a BMP/JPG/TGA to a Surface?

> FreeBASIC already have 'standalone' reusable functions that loads JPG/TGA
> (BMP is internally supported via BLoad). However, when I pass the loaded
> image to cairo, it has an offset of 8-pixels. See this image to see what I
> mean.
> http://konsolscript.org/~mjmendoza/freebasic/cairo/bmp-problem.png

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100601/8e681e05/attachment.html>


More information about the cairo mailing list