Hello, I would like to have my CMYK image fade out to black. I used the example 
in paragraph 10.2.1 of " iText in Action - second edition"On the screen it 
looks ok, but when printed I there is some color mismatch on a specific part of 
the image. I was wondering if this could be caused by the fact that the mask 
(as used in the example) is using a DeviceRGB ? I modified the code as follows, 
but then I receive a "this image can not be an image mask"  exception:          
   byte[] gradient = new byte[imageWidth * 4]; //using 4 bytes per pixel 
because of CMYK has 4 components ??
 
            for (int i = 0; i < imageWidth; lcv++)
            {
                gradient[i * 4] = 255;        //fading to black, so the cyan 
part not to be masked ?
                gradient[i * 4 + 1] = 255;    //fading to black, so the magenta 
part not to be masked ?
                gradient[i * 4 + 2] = 255;    //fading to black, so the yellow 
part not to be masked ?
                gradient[i * 4 + 3] = (byte)(255 * (imageWidth - 1 - lcv) / 
(imageWidth - 1)); //fading to black
            }
 
            Image result = Image.GetInstance(gradient.Length, 1, 4, 8, 
gradient); //4, 8, gradient); 
            result.MakeMask();
 PS: as you can see I'm using iText# Thanks !
                                          
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to