ios - Merge Two Image on to one Image programmatically in iphone -


hello developing application requires merge 2 image , image size 320*240 merging both image want size 320 * 480 . how can programitically . following images

first image second image

===================================================================================

enter image description here

just tested this, create context based on sizes of images working , draw them on top of each other (this assumes same width):

uiimage *image1 = [uiimage imagenamed:@"image1.png"]; uiimage *image2 = [uiimage imagenamed:@"image2.png"];  cgsize size = cgsizemake(image1.size.width, image1.size.height + image2.size.height);  uigraphicsbeginimagecontext(size);  [image1 drawinrect:cgrectmake(0,0,size.width, image1.size.height)]; [image2 drawinrect:cgrectmake(0,image1.size.height,size.width, image2.size.height)];  uiimage *finalimage = uigraphicsgetimagefromcurrentimagecontext();  uigraphicsendimagecontext();  //add image view uiimageview *imageview = [[uiimageview alloc] initwithframe:cgrectmake(0, 0, finalimage.size.width, finalimage.size.height)]; imageview.image = finalimage; [self.view addsubview:imageview]; 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -