jjzjj

pageRect

全部标签

ios - 为什么应用程序在将 pdf 页面转换为 ios 中的高质量图像时由于内存警告而终止,在真实设备中 swift

我正在尝试获取每个pdf页面的图像(高质量)。我正在使用下面的代码通过for循环运行直到页面计数并且它有效。guardletdocument=CGPDFDocument(pdfurlasCFURL)else{return}guardletpage=document.page(at:i)else{return}letdpi:CGFloat=300.0/72.0letpagerect=page.getBoxRect(.mediaBox)print(pagebounds)print(pagerect)letrender=UIGraphicsImageRenderer(size:CGSize(

iphone - 在 Collection View 中加载图像的更快方法

我的UICollectionView有一点流程问题。我想像在Apple的iBook应用程序中一样显示PDF的缩略图,当我滚动我的收藏View时,我发现它不是很流畅。这是我用来加载图片的方式:-(UICollectionViewCell*)collectionView:(UICollectionView*)cvcellForItemAtIndexPath:(NSIndexPath*)indexPath{GridCell*cell=[cvdequeueReusableCellWithReuseIdentifier:@"gridCell"forIndexPath:indexPath];...

iphone - iphone 错误 : Assertion failed: (s->stack->next ! = NULL),函数 CGGStackRestore,文件 Context/CGGStack.c,第 116 行

我的代码如下。我得到的错误是断言失败:(s->stack->next!=NULL),函数CGGStackRestore,文件Context/CGGStack.c,第116行。代码:CGPDFPageRefpage=CGPDFDocumentGetPage(document,i+1);CGRectpageRect=CGPDFPageGetBoxRect(page,kCGPDFMediaBox);CGFloatpdfScale=width/pageRect.size.width;pageRect.size=CGSizeMake(pageRect.size.width*pdfScale,pa