ios - Combine two UIImageView in to one image stretching -


when tried 2 combine 2 uiimageview images stretching here's code using

cgsize size =cgsizemake(max(self.imgcapture.size.width, self.imggallary.size.width), max(self.imgcapture.size.height, self.imggallary.size.height));  uigraphicsbeginimagecontext(size);  [self.imgcaptured.image drawinrect:cgrectmake(self.view.frame.origin.x,self.view.frame.origin.y,size.width/2,self.imgcapture.size.height)];  [self.imggallarycd.image drawinrect:cgrectmake(self.view.frame.origin.x+(size.width/2),self.view.frame.origin.y,size.width/2,self.imggallary.size.height)];  uiimage *finalimage = uigraphicsgetimagefromcurrentimagecontext(); 

here's first screenshot there 2 uiimageview's

enter image description here

second screenshot when combine image 1 image stretching want aspect ratio screenshot 1

enter image description here

the image not "stretching". squeezing. it's matter of simple arithmetic. looking @ image context size , drawinrect commands, see image context size of one image, drawing both images @ half width. squeezed horizontally. need image context size of both images added together.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -