Re: Cropping an NSBitmapImageRep to a given NSRect?
Re: Cropping an NSBitmapImageRep to a given NSRect?
- Subject: Re: Cropping an NSBitmapImageRep to a given NSRect?
- From: Graham Cox <email@hidden>
- Date: Mon, 21 Apr 2008 22:41:16 +1000
Hard to tell from the code posted. Maybe extent is incorrect?
You can just draw the source imageRep directly - you don't have to
wrap it in an image, and given that you just want a straight copy
it'll be simpler too. Use [imageRep drawAtPoint:...] This may not have
a bearing on your problem but the simpler the code, the easier to
debug :)
Having different colourspaces shouldn't matter - the drawing operation
will convert the image as necessary.
G.
On 21 Apr 2008, at 10:23 pm, Daniel Thorpe wrote:
Thanks Graham, I've just tried NSCompositeCopy, still doesn't work,
no change...
One thing that I've noticed though, is that the source is a
grayscale image, but the image that I'm creating is RGB. Should I
perhaps be creating a new bitmap image rep in the target (of the
same colorSpace) before calling the compositeToPoint method?
Cheers
Dan
On 21 Apr 2008, at 12:57, Graham Cox wrote:
Oops, I meant NSCompositeCopy
g.
On 21 Apr 2008, at 9:55 pm, Graham Cox wrote:
On 21 Apr 2008, at 9:43 pm, Daniel Thorpe wrote:
[source compositeToPoint:NSZeroPoint fromRect:extent
operation:NSCompositeSourceIn fraction:1.0];
Try using NSCompositeSourceCopy here instead.
G.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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