iphone - how to convert the part of UIView into UIImage and display it in imageView -
i have view in drawing signature want signature part of view should converted uiimage
, display in uiimageview
here code got net using converting
uigraphicsbeginimagecontext(signatureview.bounds.size); [signatureview.layer renderincontext:uigraphicsgetcurrentcontext()]; uiimage *img = uigraphicsgetimagefromcurrentimagecontext(); logoimageview.image=img; uigraphicsendimagecontext();
try hope you.
- (uiimage *) getuiimagewithmyview:(uimyview *)myview { uigraphicsbeginimagecontextwithoptions(myview.bounds.size, myview.opaque, 0.0); [myview.layer renderincontext:uigraphicsgetcurrentcontext()]; uiimage * myimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return myimage; }
Comments
Post a Comment