compositing a masked image and printing
compositing a masked image and printing
- Subject: compositing a masked image and printing
- From: "Ilja A. Iwas" <email@hidden>
- Date: Wed, 24 Mar 2004 00:29:13 +0100
Hi list,
I'm having trouble compositing an NSImage object with a custom mask
image. My code works like a charm when drawing on screen, but fails
when printed out on paper. The mask is not applied when printed,
instead I get the whole picture.
Here is a simplified version of my code:
- (void) drawRect:(NSRect) inRect
{
NSImage *temp = [[NSImage alloc] initWithSize:[self bounds].size];
NSImage *mask;
mask = [self maskImage]; // produces a mask image constructed using
compositeToPoint: with NSCompositeSourceIn
[temp lockFocus];
[mask compositeToPoint:NSZeroPoint operation:NSCompositeSourceOver];
[[self image] compositeToPoint:thePoint operation:NSCompositeSourceIn];
[temp unlockFocus];
[temp drawAtPoint:NSZeroPoint
fromRect:NSZeroRect
operation:NSCompositeSourceOver
fraction:1.0];
[temp release];
}
I referred to the 'Cropped Image' example for help, but although you
can print the cropped image from it, the actual printing code isn't in
there.
Please let me know if you have an idea,
Ilja A. Iwas
<www.iwascoding.com>
_______________________________________________
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.