uiview - Interpolation issue after renderInContext:UIGraphicsGetCurrentContext(), iOS -
i have few uivies butted edge edge. views cover superview. looks great in display, when rendered adjoining edges visible, sat line appears between them. since views perfect in display, imagine must interpolation of pixels of views causes this.
anyone know how fix this?
the image below render. on device or simulator lines not visible.
render code
-(void)renderimage { cgsize rendersize = cgsizemake(masterview.frame.size.width, masterview.frame.size.height); uigraphicsbeginimagecontext(rendersize); cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextsavegstate(context); cgcontextconcatctm(context, [[masterview layer] affinetransform]); [[masterview layer] renderincontext:uigraphicsgetcurrentcontext()]; renderedimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); cgcontextrestoregstate(context); uiimagewritetosavedphotosalbum(renderedimage, self, @selector(image:didfinishsavingwitherror:contextinfo:), nil); masterview.transform = cgaffinetransformidentity; }
core graphics attempts anti alias views. need tell not that.
consider following example renders self, uiview, uiimage without anti aliasing:
uigraphicsbeginimagecontextwithoptions(self.bounds.size, yes, [[uiscreen mainscreen] scale]); cgcontextsetallowsantialiasing(uigraphicsgetcurrentcontext(), false); [self.layer renderincontext:uigraphicsgetcurrentcontext()]; uiimage *image = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext();