Re: painting bitmaps onto a PDF surface
Arjen Nienhuis <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAG6W84LoF3U_Fa=QSbArXGmxukimF7ec-jSEzNF77_RNmc+QKA@mail.gmail.com> |
On Jun 21, 2013 6:42 PM, "Ratner, Logan" <[email protected]> wrote: > > I started to create the images to show the problem, and discovered that the problem isn't where I thought it was. What I describe below works. So, next question: Is this mailing list the right place for Poppler issues? Might be, if its poppler with cairo. > > Logan > > ________________________________________ > From: Arjen Nienhuis > Sent: Thursday, June 20, 2013 2:12 PM > To: Ratner, Logan > Cc: [email protected] > Subject: Re: [cairo] painting bitmaps onto a PDF surface > > 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