• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cropping


  • Subject: Re: Cropping
  • From: Robert Walker <email@hidden>
  • Date: Wed, 24 May 2006 15:22:13 -0400

image = [[CIImage alloc]initWithBitmapImageRep:myImageRep];

If you are already using Core Image why not use it's cropping function:

...
...
// Crop the output image to be within the rect of the thumbnail.
crop = [CIFilter filterWithName: @"CICrop"
keysAndValues: @"inputImage", [transition valueForKey: @"outputImage"], @"inputRectangle",
[CIVector vectorWithX: 0 Y: 0 Z: bounds.size.width W: bounds.size.height], nil];
...
...


On May 24, 2006, at 3:13 PM, Terry Heaford wrote:

I have been trying to implement a cropping routine for an image.

I have got this far, it seems to work but I am unsure if the first two lines are suitable for getting the cropped part of the image. Can someone please confirm or point me in the right direction.




NSBitmapImageRep *myImageRep = [self bitmapImageRepForCachingDisplayInRect:selectedRect];
[self cacheDisplayInRect:selectedRect toBitmapImageRep:myImageRep];

[image release];
image = [[CIImage alloc]initWithBitmapImageRep:myImageRep];
[image retain];
[self adjustFrame];
selectedRect = NSZeroRect;



Thanks

--Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden

-- Robert Walker email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cropping
      • From: Terry Heaford <email@hidden>
References: 
 >Cropping (From: Terry Heaford <email@hidden>)

  • Prev by Date: Cropping
  • Next by Date: Re: view hierarchy inspector (for debugging)?
  • Previous by thread: Cropping
  • Next by thread: Re: Cropping
  • Index(es):
    • Date
    • Thread