Text and pictures
UIImage *image = self.showedImageView.image; Get a picture
Uigraphicsbeginimagecontext (image.size); Open context
[Image drawinrect:cgrectmake (0, 0, W, h)]; Picture painting
Nsdictionary *attr = @{nsfontattributename:[uifont monospaceddigitsystemfontofsize:268 weight:10], Nsforegroundcolorattributename:[uicolor Redcolor],nsstrokecolorattributename:[uicolor LightGrayColor]};
[Mark Drawinrect:cgrectmake (+, W, h) withattributes:attr];//text rendering
UIImage *newimage = Uigraphicsgetimagefromcurrentimagecontext ();//Get to the newly drawn picture
Uigraphicsendimagecontext (); Close context
Pictures and pictures
uigraphicsbeginimagecontextwithoptions (useimage.size, NO, 0.0);
[Useimage drawinrect:cgrectmake (0, 0, UseImage.size.width, useImage.size.height)]; Background image
[Maskimage drawinrect:cgrectmake (0, 0, USEIMAGE.SIZE.WIDTH/2, USEIMAGE.SIZE.HEIGHT/2)];
UIImage *resultimage = Uigraphicsgetimagefromcurrentimagecontext ();
Uigraphicsendimagecontext ();
Text and pictures redraw to a picture/picture and picture redraw to a photo