iPhone:-simplest way to crop image of desired shape and size
iphone, xcode
Solution
Here is the exact code to resize your image to desired size
CGSize itemSize = CGSizeMake(320,480); // give any size you want to give
UIGraphicsBeginImageContext(itemSize);
CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
[myimage drawInRect:imageRect];
myimage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Now my image is of your desired size
Problem
i am trying to crop image according to my desire....for my cinemagram type app.....and use it in my application i have tried a lot of options but none of tham is...usefull for me i read answers on stack over flow but of no use plzz help me out ``` image = [UIImage imageNamed:@"images2.jpg"]; imageView = [[UIImageView alloc] initWithImage:image]; CGSize size = [image size]; [imageView setFrame:CGRectMake(0, 0, size.width, size.height)]; [[self view] addSubview:imageView]; [imageView release]; ``` thanks