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
second screenshot when combine image 1 image stretching want aspect ratio screenshot 1
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
Post a Comment