Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私のアプリでは、UICollectionViewでタップした後、QLPreviewControllerを使用していくつかのドキュメントを表示/読み取りています。collectionViewのセルにはUIImageViewがあり、ドキュメントの最初のページを画像のように表示したいと思います。
どうすればそれを作ることができますか?
標準的な方法を試してください:
UIGraphicsBeginImageContext(rect); [qlController.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
rect画像に変換するビューの領域を選択するように定義できます。
rect