// 需要轉成image的view:captureandsaveview
uigraphicsbeginimagecontextwithoptions(captureandsaveview.frame.size, no, 1.0); //no,yes 控制是否透明
[captureandsaveview.layer renderincontext:uigraphicsgetcurrentcontext()];
uiimage *image = uigraphicsgetimagefromcurrentimagecontext();
uigraphicsendimagecontext();
// 生成後的image