繁体   English   中英

iPhone-在UIImageView中放置和处理相机中的图像

[英]iPhone - Putting and manipulating an Image from the Camera in a UIImageView

这就是我想做的:

  1. 将相机图像放入小(非全屏)UIImageView中。
  2. 实时处理图像(例如,将其中一半设置为红色)。

我已经检查了这个问题,并且不确定最佳方法。 人们建议同时使用UIImagePickerController和AVCamCaptureManager,或者还有其他功能。

请问您有什么建议吗?

  • (void)drawRect:(CGRect)rect {

    CGContextRef context = UIGraphicsGetCurrentContext();

    CGContextSetFillColor(context,CGColorGetComponents([UIColor colorWithRed:0.5 green:0.5 blue:0 alpha:1] .CGColor)); //不要让颜色太饱和

    CGContextFillRect(context,rect); //画底

    [[UIImage imageNamed:@“ someImage.png”] drawInRect:rect blendMode:kCGBlendModeOverlay alpha:1.0]; //绘制图像}

在rect变量中传递要着色的图像区域

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM