Re: painting bitmaps onto a PDF surface
Arjen Nienhuis <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAG6W84+MN-7khjx14h4HnTBo3wOav_C-7fiFRRPAm0VvNyhqCg@mail.gmail.com> |
On Thu, Jun 20, 2013 at 7:37 PM, Ratner, Logan <[email protected]> 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 > [email protected] | P: 713.335.1524 > www.bluware.com | We bring your vision to code. > > > > -- > cairo mailing list > [email protected] > http://lists.cairographics.org/mailman/listinfo/cairo -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo