私のアプリでは:
私はclipsToBound=YESのビュー(UIView * myView)を持っています。
境界の原点プロパティを変更するためのボタンがあります。
CGRect newRect = myView.bounds; newRect.origin.x += 100; myView.bounds = newRect; myView.layer.frame = newRect;
- 次に、ビューから画像を取得します。
UIGraphicsBeginImageContext(myView.bounds.size); [myView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage_after = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage_after, nil, nil, nil);
思いもよらないイメージになります。iPhoneの画面に表示されている画像が欲しいです。
ここのコードへのリンク: http ://www.mediafire.com/?ufr1q8lbd434wu1
私を助けてください!