iphone - How combine UIImageViews and and save as Single in Gallery as Single Image -
in new iphone project, want combine 5 uiimageviews , and save single in gallery single image.. 5 images in same view possible..?
this combining 2 images 1, you'll need tweak 5.
- (uiimage*)imagebycombiningimage:(uiimage*)firstimage withimage:(uiimage*)secondimage { uiimage *image = nil; cgsize newimagesize = cgsizemake(max(firstimage.size.width, secondimage.size.width), max(firstimage.size.height, secondimage.size.height)); if (uigraphicsbeginimagecontextwithoptions != null) { uigraphicsbeginimagecontextwithoptions(newimagesize, no, [[uiscreen mainscreen] scale]); } else { uigraphicsbeginimagecontext(newimagesize); } [firstimage drawatpoint:cgpointmake(roundf((newimagesize.width-firstimage.size.width)/2), roundf((newimagesize.height-firstimage.size.height)/2))]; [secondimage drawatpoint:cgpointmake(roundf((newimagesize.width-secondimage.size.width)/2), roundf((newimagesize.height-secondimage.size.height)/2))]; image = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return image; }
Comments
Post a Comment