이 바뀌는 필요할 수 있습니다, 그래서 내가 멀리 엑스 코드에서이 쓰고 있어요 ...
가있는 UIImage의 특성을 가진 UIView의 클래스를 작성, 사진 & 오버레이 &은 compositorView와 같은 것으로 부릅니다. UIImagePickerController 대리자의 didFinishPickingMediaWithInfo : 메서드에서 compositorView의 그림 속성을 방금 찍은 사진으로 설정하십시오. &은 사용중인 이미지의 오버레이 속성입니다. 그런 다음
(당신은 QuartzCore 프레임 워크가 필요합니다) 내가 위 .. 감사를 사용하려고 가지고 드리려고에 대한
@synthesize picture = _picture;
@synthesize overlay = _overlay;
-(void)drawRect:(CGRect)rect
{
CGFloat width = self.frame.size.width;
CGFloat height = self.frame.size.height;
CGRect frame = CGRectMake(0, 0, width, height);
[_picture drawInRect:frame];
[_overlay drawInRect:frame];
}
-(UIImage *)composedImage
{
CGSize pageSize = self.frame.size;
UIGraphicsBeginImageContextWithOptions(pageSize, NO, 2.0);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.layer renderInContext:context];
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;
}
감사합니다 ... 그 composedImage, 그것을해야 &에 대한 compositorView을 부탁드립니다. LB – theiOSDude