A short follow up to my previous post:
If I use the CIImage instance directly, e.g. in the -drawRect: method of a custom NSView subclass – something like
- (void)drawRect:(NSRect)rect
{
if( _image )
{
CIContext *context = [[NSGraphicsContext currentContext] CIContext];
CGRect cg = CGRectMake(NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect));
if( context )
{
[context drawImage:_image atPoint:cg.origin fromRect:cg];
}
}
}
the image gets drawn correctly.
(And I forget to mention in my previous mail that the cropped and converted NSImage instances, when logged to console, had the right values in the origin portion of the extent struct, like
NSImage 0x3e2d30 Size={144, 108} Reps=(
NSCIImageRep 0x3eee10 Size={144, 108} ColorSpace=NSCalibratedRGBColorSpace BPS=0 Pixels=144x108 Alpha=NO CIImage={CIImage [0 19 144 108]}
))
So it seems the "incorrect" behavior i'm experiencing stems from the conversion of the CIImage instance to an instance of class NSImage as done in the code I've posted before!(?)
Comments?
Thanks in advance,
Thomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Help/Unsubscribe/Update your Subscription: