0
當我用旋轉參數調用CGPDFPageGetDrawingTransform()時,應用程序崩潰。如果我指定不旋轉,則不會崩潰。爲什麼CGPDFPageGetDrawingTransform()在指定旋轉時與SIGABRT一起崩潰?
這裏是我的drawLayer:inContext的:方法:
- (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context
{
CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
CGRect boundingBox = CGContextGetClipBoundingBox(context);
CGContextFillRect(context, boundingBox);
//convert to UIKit native coodinate system
CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
//Rotate the pdf_page
CGAffineTransform pfd_transform = CGPDFPageGetDrawingTransform(self.page, kCGPDFCropBox, self.frame, 58.46f, true);
CGContextSaveGState (context);
CGContextConcatCTM (context, pfd_transform);
CGContextClipToRect (context, self.frame);
CGContextDrawPDFPage (context, self.page);
CGContextRestoreGState (context);
}
從長遠來看,我想動態旋轉PDF遵循用戶的標題。也許我在這一切都是錯誤的...
謝謝你的時間。
03,我應該有更多的文字和依賴少了些什麼,我試圖做多!謝謝! – David 2010-06-06 02:26:51