Ok so we're doing an application in Phonegap and there's only one thing we need to change in the source - the capture size from the camera.
I managed by with Android in Eclipse, but ObjC is giving me some woahs.
It worked BEFORE I tried to calculate the imageRatio and I know Xcode is telling me there's "Incompatible types in initialization" on the line 2 I just don't know what what would be the compatible type.
Basically I'm resizing the image to 1024x768. If it's portrait use the 768x1024.
I managed by with Android in Eclipse, but ObjC is giving me some woahs.
Code:
CGSize size = [image size];
NSValue *imagewidth = [NSValue valueWithCGSize:size.width];
NSValue *imageheight = [NSValue valueWithCGSize:size.height];
NSValue *imageRatio = imagewidth / imageheight;
if (imageRatio < 1 ) {
CGSize newSize = CGSizeMake(768,1024);
} else {
CGSize newSize = CGSizeMake(1024,768);
}
UIGraphicsBeginImageContext( newSize );
[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
It worked BEFORE I tried to calculate the imageRatio and I know Xcode is telling me there's "Incompatible types in initialization" on the line 2 I just don't know what what would be the compatible type.
Basically I'm resizing the image to 1024x768. If it's portrait use the 768x1024.