Pixmaps and colortables

Kees Kling <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Hi,

I'm using cairo with Gtkmm and I need to display images from in memory 
data. Searched a lot, but can't find the correct functions


Here a snippet of my example code, which doesn't work;

unsigned char* buffer = (unsigned char*) CPLMalloc(sizeof(char) * 
dataset->GetRasterXSize() *
             dataset->GetRasterYSize() * dataset->GetRasterCount());

dataset->getPixelData(buffer);

Cairo::RefPtr<Cairo::ImageSurface> sfc = 
Cairo::ImageSurface::create(buffer,Cairo::FORMAT_A8,
                         dataset->GetRasterXSize(), 
dataset->GetRasterYSize(), dataset->GetRasterXSize());
cr->set_source(sfc,0,0);

buffer is just a char array, filled from the dataset. Result is a 
greyscaled but correct image. I need a color image and colors must be 
specified in a colortable , and I need full access to that table.

Is there a way to do it

Regards

Kees Kling


-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.