UIImageView 内に表示される UIImage で奇妙な問題が発生しています。
173x173 の画像ビュー内に 1024x1024 の画像を配置し、「塗りつぶしに合わせて拡大縮小」を設定すると、結果がエイリアス化されます。ただし、同じ画像を入れて、imageview のスクリーンショットを撮り、それを元に戻すと、画像は完全に表示されます。スクリーンショットは、画像ビュー内で見ている正確なピクセルであるはずなので、これは気になります。
左側は画像を直接割り当てた結果です。右側は、同じ画像のスクリーンショットを撮り、それを割り当てています。Es が左側ではギザギザになっていますが、右側では滑らかになっています。
これは、画像ビューのコンテンツ モードの問題ですか、それともスクリーン ショット中に何かが起こりますか?
for(UIImageView* placeholderView in self.placeholderImageViews)
{
//assigning a 1024x1024 image into a smaller image view results in an aliased image here
placeholderView.image = imageToDisplay;
//this code makes the image appear perfectly scaled down
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
{
UIGraphicsBeginImageContextWithOptions(placeholderView.frame.size, NO, [UIScreen mainScreen].scale);
}
else
{
UIGraphicsBeginImageContext(placeholderView.frame.size);
}
[placeholderView.layer renderInContext:UIGraphicsGetCurrentContext()];
screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//save the result
placeholderView.image = screenshot;
}