1
2835 픽셀 UIScrollView 내에 2835 픽셀 PDF 파일이 있습니다. PDF를 표시하려면 CATiledLayer를 사용합니다.UIScrollView 내에서 PDF 확대
내 문제는 scrollView (1 이하의 배율)를 축소하면 PDF 품질이 매우 나 빠진다는 것입니다. scrollView (1보다 큰 축척으로)를 확대했을 때 PDF가 멋지게 보이는 것은 이상합니다. 확대 할수록 (배율 * 10) 화질이 좋아집니다.
다운 스케일과 고급 품질이 모두 좋도록 코드를 변경하려면 어떻게해야합니까? 내가 levelsOfDetail과 10이에 levelsOfDetailBias 모두를 설정 한
는// Draw the CGPDFPageRef into the layer at the correct scale.
-(void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context
{
// First fill the background with white.
//CGContextSetRGBFillColor(context, 1.0,1.0,1.0,1.0);
CGContextFillRect(context,CGRectMake(0, 0, 2835,1417));
CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
CGContextSaveGState(context);
// Flip the context so that the PDF page is rendered
// right side up.
CGContextTranslateCTM(context, 0.0, 1417);
CGContextScaleCTM(context, 1.0, -1.0);
// Scale the context so that the PDF page is rendered
// at the correct size for the zoom level.
CGContextScaleCTM(context, myScale,myScale);
CGContextDrawPDFPage(context, pdfPage);
CGContextRestoreGState(context);
}