2

I want to crop this image

Crop this image

And get this result

And get this result

I have been banging my head around for some time now and still can't achieve this.

Should I do this with CIImage or CGContext?

How to calculate cutting frame after rotating image?

NFilip
  • 427
  • 4
  • 15
  • Do you have any current code or do you just not know where to start? – tktsubota Feb 16 '16 at 16:50
  • I made too much attempts that failed, many calculations and transformation and I'm so confused right now that it is better to say that I don't have any code. – NFilip Feb 17 '16 at 07:35
  • If you can read Objective-C, [here's something](http://stackoverflow.com/questions/25822730/rotate-and-crop-uiimage). – tktsubota Feb 17 '16 at 17:17
  • I can read Objective-C and I saw this answer but I don't know how to calculate rect ("someRect" in link you provided) which I have to crop because when I rotate image image size change and also rect I want to crop has different coordinates. – NFilip Feb 18 '16 at 07:49
  • Do you know the rect of the image you want to crop, or do you want to be able to calculate where the insect is? – tktsubota Feb 18 '16 at 16:45
  • I know the rect of the image I want to crop before I make rotation, when I rotate image rect I want to crop will have different origin and I don't know how to calculate that new origin. – NFilip Feb 18 '16 at 19:27
  • Do you know how much you want to rotate (the transformation)? – tktsubota Feb 18 '16 at 19:50
  • Yes, I know that too – NFilip Feb 18 '16 at 19:55
  • @NFilip: How did you've solved? looking for center (vertically) & right (horizontal) crop. – el.severo May 26 '16 at 10:31

0 Answers0