• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cropping an NSBitmapImageRep to a given NSRect?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Cropping an NSBitmapImageRep to a given NSRect? [Solved]
      • From: Daniel Thorpe <email@hidden>
    • Re: Cropping an NSBitmapImageRep to a given NSRect?
      • From: Daniel Thorpe <email@hidden>
References: 
 >Cropping an NSBitmapImageRep to a given NSRect? (From: Daniel Thorpe <email@hidden>)
 >Re: Cropping an NSBitmapImageRep to a given NSRect? (From: Graham Cox <email@hidden>)
 >Re: Cropping an NSBitmapImageRep to a given NSRect? (From: Graham Cox <email@hidden>)
 >Re: Cropping an NSBitmapImageRep to a given NSRect? (From: Daniel Thorpe <email@hidden>)

  • Prev by Date: Fullscreen mode detection from background
  • Next by Date: Re: After Unarchive Object Exists, After First GUI Action, gone...
  • Previous by thread: Re: Cropping an NSBitmapImageRep to a given NSRect?
  • Next by thread: Re: Cropping an NSBitmapImageRep to a given NSRect?
  • Index(es):
    • Date
    • Thread