[cairo] painting bitmaps onto a PDF surface

Ratner, Logan logan.ratner at bluware.com
Thu Jun 20 10:37:28 PDT 2013


Hello,

I am using Cairomm to create some images.  I am trying to paint an ImageSurface onto a device surface, having written data into the surface.  I'm doing this two ways, either by setting the ImageSurface as the source directly, or by creating a SurfacePattern from the ImageSurface.  The image has two colors, one of which has an alpha of 0.

Either way works fine if I use a PNG device surface, but if I try the exact same thing with a PDF device surface, the "invisible" color isn't invisible.

As I research this I go back and forth between "this should just work" and "this is impossible" but surely there is a way to do what I need.

Here's what I'm trying:

RefPtr<ImageSurface> csurf = ImageSurface::create(FORMAT_ARGB32, s.height, s.width);
/* code to write the image surface */
RefPtr<SurfacePattern> fillpat = SurfacePattern::create(csurf)
fillpat->set_extend(EXTEND_REPEAT);
ctx.set_source(fillpat);
ctx.paint();

Or:

RefPtr<ImageSurface> csurf = ImageSurface::create(FORMAT_ARGB32, s.height, s.width);
/* code to write the image surface */
ctx.set_source(meshimage, 0, 0);
ctx.paint();

Any help would be much appreciated.
Thanks in advance,

Logan

--
Logan Ratner | Senior Consultant | Bluware Inc.
16285 Park 10 Place Suite 300, Houston, TX 77084
logan.ratner at bluware.com | P: 713.335.1524
www.bluware.com | We bring your vision to code.

<http://www.fergusonbeauregard.com/>

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


More information about the cairo mailing list