相关疑难解决方法(0)

适用于iOS的Image Cropping API

是否有任何裁剪图像API用于在Xcode项目中动态裁剪图像的目标C?请提供一些技巧或技巧,如何在iPhone中裁剪相机图像.

image crop objective-c

26
推荐指数
3
解决办法
4万
查看次数

UIImage调整大小不正常

所以我一直试图弄清楚我现在做错了一段时间,我无法弄明白.我想要完成的是:

  1. 拍张照片 UIImagePickerController
  2. 拍摄照片并从顶部和底部裁剪,使其成为正方形(类似于Instagram)
  3. 在a中显示该图像 UIButton

出于某种原因,每次我拍摄照片时都会在照片内失真UIButton,看起来好像裁剪不能正常工作.这就是我的工作.在didFinishPickingMediaWithInfo方法中我有以下代码:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    //Copy the image to the userImage variable
    [picker dismissModalViewControllerAnimated:YES];
    userImage = nil;

    //Rotate & resize image
    userImage = [self resizeAndRotatePhoto:(UIImage *)[info objectForKey:UIImagePickerControllerOriginalImage]];
    NSLog(@"Userimage size, width: %f , height: %f", userImage.size.width , userImage.size.height);

    //Update the image form field with the image and set the image in the controller
    NSLog(@"Button size is height: %f , width: %f" , userImageAvatarButton.frame.size.height , userImageAvatarButton.frame.size.width);
   [userImageAvatarButton.layer setMasksToBounds:YES];
   [userImageAvatarButton.layer setCornerRadius:3.0]; …
Run Code Online (Sandbox Code Playgroud)

cocoa-touch objective-c ios4 ios ios5

8
推荐指数
1
解决办法
6350
查看次数

标签 统计

objective-c ×2

cocoa-touch ×1

crop ×1

image ×1

ios ×1

ios4 ×1

ios5 ×1