Hi, 
I am actually using iTextSharp, but I'm asking here in case the problem is
more universal - I'm trying to use a black and white gif as an image mask. 
Included here is a snippet of the code which is creating a PDF for printing
based on various input. 
xImg below is a iTextSharp.text.Image, as is imask.
xRotate, xPOs, yPos, yShift are all floats.
iDocument is an iTextSharp.text.Document.

If I do this, the image is positioned correctly and rotated correctly, but
is not masked:
xImg.RotationDegrees = Math.Abs(xRotate);
xImg.SetAbsolutePosition(xPos, yPos + (xImg.Height - yShift));
iDocument.Add(xImg);


If I do this, no image appears at all:
xImg.RotationDegrees = Math.Abs(xRotate);
xImg.SetAbsolutePosition(xPos, yPos + (xImg.Height - yShift));
xImg.ImageMask = imask;
iDocument.Add(xImg);


But if I do this, I get two images - one in its proper place, not masked,
and one at the test place (100,100), which IS masked!
xImg.RotationDegrees = Math.Abs(xRotate);
xImg.SetAbsolutePosition(xPos, yPos + (xImg.Height - yShift));
iDocument.Add(xImg);
xImg.ImageMask = imask;
xImg.SetAbsolutePosition(100, 100);
iDocument.Add(xImg);


Does anyone know why the second one is not rendering? It's like it just
refuses to mask at the desired location (in fact, if I switch the above so
the 100,100 is not masked and the real location is, i get no image at all!).
And more importantly, anyone know how i can accomplish this? I am probably
making some glaring error, but I'm a little fuzzy on the use of the image
mask in iText, as is the documentation and even the In Action book. 
Thanks in advance, 
Ian


-- 
View this message in context: 
http://www.nabble.com/problem-with-image-mask-tp23856889p23856889.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to