[cairo] painting bitmaps onto a PDF surface

Arjen Nienhuis a.g.nienhuis at gmail.com
Thu Jun 20 12:12:42 PDT 2013


On Thu, Jun 20, 2013 at 7:37 PM, Ratner, Logan <logan.ratner at bluware.com> wrote:
> 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.

Can you show us the "I expected this" and the "I got this instead" images?

>
> 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.
>
>
>
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list