printing over-optimizing ?
printing over-optimizing ?
- Subject: printing over-optimizing ?
- From: Robert Clair <email@hidden>
- Date: Thu, 15 May 2003 22:54:00 -0400
I need to display the same, essentially monochrome, transparent
background image
in different colors in different views. (The image is wrapped in
one of my graphics objects that goes on a display list.) I do this
by recoloring the image to the currently needed color, checking to see
if the new color is the same as the last:
if ( ! [lastColor areComponentsEqual: fillColor )
{
NSRect tmpRect;
tmpRect.origin = NSZeroPoint;
tmpRect.size = [image size];
[image lockFocus];
[fillColor set];
lastColor = fillColor;
NSRectFillUsingOperation( tmpRect, NSCompositeSourceIn );
[image unlockFocus];
}
Everything works as expected, I have 4 views in the window
showing the same image in 4 different colors.
The problem is printing - when I go to print the 4 views at once,
all four images come out the color of the first one. Something in the
system is trying to be efficient and reuse its first version of the
image
despite the fact the the image has changed. I've tried all manner
of [[NSGraphics currentContext] flushGraphics] and
[image recache] between the calls to the 4 different views' drawRect
routine with no success. (I have verified that it goes through
the recoloring code when it prints.)
Is there anyway to force the system to let go of the first version
of the image ?
Thanks,
Bob Clair
Robert Clair
51 Slade St.
Belmont, MA 02478
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.