1

2835ピクセルのUIScrollView内に2835ピクセルのPDFファイルがあります。PDFを表示するには、CATiledLayerを使用します。

私の問題は、scrollViewをズームアウトすると(1未満のスケールで)、PDFの品質が非常に悪くなることです。scrollViewを(1より上のスケールで)ズームインすると、PDFが見栄えがするのは奇妙なことです。ズームイン(スケール* 10)すればするほど品質が良くなります。

ダウンスケールとアップスケールの両方の品質が良好になるようにコードを変更するにはどうすればよいですか?

// 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);

}
4

1 に答える 1

0

私はlevelsOfDetailとlevelsOfDetailBiasの両方を10に設定していました。これにより、すべてのズームがアップサクラにシフトしました。ここで、levelsOfDetailを10に、levelsOfDetailBiasを7に変更しましたが、すべて問題なく動作します。

于 2011-03-11T20:26:29.123 に答える