I have a bunch of PDFs which I am writing in using an app as vector art. I'm using the CG reference command CGContextDrawPDFPage to draw PDF, and it's working great so far. I have gone into a problem that I want to be able to modify the color of vector art in order. All PDFs are currently attracted to solid black color because they were designed.
Is it possible to draw a PDF, but by what color will this color change in any way? Perhaps modify the color palette so that the black map can be converted to something else, or indeed the PDF at runtime? I realize that PDF already has color information in the file, so it is possible that quartz can be asked to ignore those colors and use something else?
More information: The different PDFs I am looking at, which have to attract the program, are some black shapes, with a transparent background. I should be able to attract that PDF, but using a different color, or Bill Wilson used the blade modes as outlined and overlay color. I tried kCGBlendModeLighten, but the problem is that if I fill the reset around the PDF, the outer transparent areas become red, so there is only one red box instead of the red size.
Color X to darken the map, but leave aside as transparent.
Here is an example of a PDF that I have to draw in different colors:
After you drag the PDF, set the blend mode of CGConext to If you are making any other drawing in the context, make sure you set the blend mode for general or reference with Experiment with the Oath blend mode and see what works best for you ... I'm not sure that this is what you want, so if it If not, you can expand, maybe you can share the PDF you are using. kCGBlendModeLighten and fill the reference with the desired color, it should give you something to start with.
CGContextSaveGstate and
CGContextRestoreGstate Save and Restore Status.
CGContextSaveGState (reference); CGContextSetBlendMode (Reference, kCGBlendModeLighten); CGColorRef redColor = [UIColor colorWithRed: 1.0 green: 0.0 blue: 0.0 alpha: 1.0] .CGColor; CGContextSetFillColorWithColor (reference, red color); CGContextFillRect (Reference, CGRectMake (0, 0, width, height)); CGContextRestoreGState (Reference)
Comments
Post a Comment