开发者

How to perform Image Editing in iPhone application?

I have to perform some image editing operation like cropping, gray scale, rotating image, Polaroid-effects etc.

From these I found some of functionality like cropping, gray scale. But from this we have to manage separate functions iN there. Is there any valid API or Library available for iPhone to perform image processing?

I use the following function for cropping:

-(UIImage *)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect
{
    CGImageRef imageRef = CGImageCreateWithImageInRect([imageToCrop CGImage], rect);
    UIImage *cropped = [UIImage imageWithCGImage:imageRef];
    CGImageRelease(imageRef);
    return cropped;
}

for this I have not idea, how to set cropping rectangle on my actual image...and how to re-size that rectangle.

Is there any method in iPhone like Android we direct crop image after capture image... by setting it`s some property we can achieve this in iPhone.

for gray scale I found something here, but for this if we perform Polaroid effect we have to manage separate enums...,

I found one Image Magik API for this but many people said apple reject app due 开发者_运维百科to private API.and also not get how to use it.

If for this or any-other API available than tell me about it and its tutorial.


check the Quartz Demo code sample by apple... especially QuartzClippingView and QuartzMaskingView...

and if you want to learn core graphics basics for image editing, a quick look at Quartz 2D Programming Guide and Drawing and Printing Guide would really help...

also, if you are planning to go for better cropping check Cropped Image .. this is for mac but it can be useful for creating similar implementation for iPhone by using Cocoa Touch counterparts of the same classes they have used e.g. instead of NSBezierPath for mac use UIBezierPath for iPhone ...


No , Using ImageMagick is absolutely valid.

Pl. follow this discussion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜