Print Page | Close Window

Adding a Gif image with transparency

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1013
Printed Date: 02 Feb 26 at 8:34AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Adding a Gif image with transparency
Posted By: Eddy
Subject: Adding a Gif image with transparency
Date Posted: 18 Feb 09 at 12:57PM
Hi,
I am trying to add a gif image to a pdf file.
Perhaps my question is stupid, but is it possible to manage the transparency of that image if it is a gif file with transparency ?
I perform a AddImageFromFile, before a drawImage... and the result is an image with a white opaque backstyle... Do I do something wrong ?
Thanks in advance.
Eddy



Replies:
Posted By: Autodidact
Date Posted: 18 Feb 09 at 2:05PM
I have only tried placing PNG-files with transparency, and although the file format supports it, the result was just as you experience with the GIF-file.

Since there are functions for making masks in the library, I tend to belive that transparence within the file is not supported. Check out the SetImageAsMask and SetImageMaskFromImage — and perhaps the ReverseImage.

Maybe I should look into it myself too ... 8o)


Posted By: Eddy
Date Posted: 18 Feb 09 at 5:07PM
 In fact, I'm working on an application in whitch a user can create a pdf file and add images or text in it. So, I can't use the mask, since I don't know in advance whitch kind of image the user will add...
I thought that quickpdf should manage that, may be I'm wrong... or maybe it is a pdf limitation...
Thanks for your answer, even if it is not exactly what I was looking for...

Eddy


Posted By: Autodidact
Date Posted: 19 Feb 09 at 1:52AM
You can set a mask based on colors in the image as well with SetImageMask/SetImageMaskCMYK, but then it is important that this color is not present in the part of the image that is to be preserved as it will make odd looking holes/gaps. In RGB, using pixels of 100% green should be the safest color to use. Using white would be asking for trouble, and as I see it, there are no way to specify a transparent pixel/color ...

There is also SetClippingPath. Images can have a clipping path added in Photoshop. I assume that would be a bit much to ask from the user to create such a path, and I am not so sure this path is what the documentation refer to but rather a path created with the library. I assume so because the function have no argument to specify the path to use. It only uses the "current path" object.

I guess this is a library limitation, where the creators maybe have chosen the easy route because the library has no support for EPS-vector graphics either, and I could really use that as EMF import is unstable, and neither it or WMF supports CMYK-colors.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk