CIContext drawing issue.
CIContext drawing issue.
- Subject: CIContext drawing issue.
- From: Cloud Strife <email@hidden>
- Date: Tue, 27 Feb 2007 18:07:17 +0000
Hi all, I am trying to draw an image in my customized NSView
subclass: CocoaDrawing:
- (void)drawRect:(NSRect)rect {
// Drawing code here.
bitmapRep = [myNSImageView bitmapImageRepForCachingDisplayInRect:
[myNSImageView visibleRect]];
NSImage * testRef = [myNSImageView image];
if (testRef != nil) {
printf("my image view contains some image\n");
}
myCIImage = [[CIImage alloc] initWithBitmapImageRep:bitmapRep];
if (myCIImage != nil) {
printf("my core image contains some image\n");
}
myCIContext = [[CIContext alloc] init];
[myCIContext drawImage:myCIImage
atPoint: CGPointZero
fromRect: CGRectMake(rect.origin.x,
rect.origin.y,
rect.size.width,
rect.size.height)];
/*[[NSColor greenColor] set];
NSRect r = NSMakeRect(10, 10, 50, 60);
NSBezierPath *bp = [NSBezierPath bezierPathWithRect:r];
[bp fill]; */
printf("Execute here?\n");
}
AS I have judged, the myCIImage and the testRef aren't nil. And I
have loaded a image to myNS
ImageView previously, however , after I call the [myCustomizedView
display], my required image doesn't appear in my customized view.
Can anyone explain what is wrong with my code?
Thank you for any help.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden