Creating an NSImage from an NSImage
Creating an NSImage from an NSImage
- Subject: Creating an NSImage from an NSImage
- From: email@hidden (tim lindner)
- Date: Mon, 25 Nov 2002 20:59:27 -0800
- Organization: Computers Suck, Inc.
In my subclass of NSImageView, I created a method to return a NSImage based upon
two rectangles:
- (NSImage *) croppedImage: (NSRect)srcRect destination: (NSRect) destRect
{
NSImage *newImage = [[NSImage alloc] initWithSize:destRect.size];
[newImage lockFocus];
[[self image] drawInRect:destRect fromRect:srcRect operation:NSCompositeCopy
fraction:1.0 ];
[newImage unlockFocus];
return [newImage autorelease];
}
But the image returned is just black. What am I doing wrong?
--
tim lindner 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.