私はUIImageViewのスクリーンショットとその上にあるUILabelを撮ろうとしています。UILabelのScreenShotとUIImageViewにあるもの
ImageViewでUIImageを取得してからオーバーレイをレンダリングしますが、UILabelの配置はすべて間違っています。キャプチャのサイズを実際のイメージサイズに設定しています(これは私が望むものではありません)。
画面に表示されているとおりにスクリーンショットを撮りたいだけです。
CGSize imageSize = self.imageFromOtherView.size;
// define the size and grab a UIImage from it
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);
[self.imageFromOtherView drawInRect:CGRectMake(0, 0, imageSize.width, imageSize.height)];
[self.socialLabel.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
画面全体またはスクリーン上の画像のスクリーンショットを取得したいですか?あなたの質問から伝えるのはちょっと難しいです。 – fsb