Image looks blurry after masking

I am developing one game where I want to enlarge the image where the magnifying glass image is placed. For this, I am using the concept of masking. After masking, I zoom in, but it looks blurry. And I want the image to be clearer as we look through the arrow magnifier. So if anyone has a solution please kindly answer

0


a source to share


2 answers


Are you sure the problem is with disguise?



Are your resources too low resolution? high resolution images are reduced, always looking better than low resolution images. Perhaps you need to look at the problem backwards ... so that your image when viewed with an arrow magnifier [scope?] Is viewed at 1: 1 resolution and when not viewed at scale it is scaled down (1: 2 resolution?) ... so your "normal" mode is thus the zoom mode, and the "enlarged view" is just a 1: 1 image.

+1


a source


If you have a UIImage that is 293x184 in size, but you create a UIImageView with an initial size of 40x30, the iPhone SCALES UIImage will match in: contentMode. By default contentMode: UIViewContentModeScaleToFill which scales your image.

So, even if you started with a large image, it is now only 40x30 and renders at 40x30. When you zoom in, it is STILL 40x30, but displayed at a larger size, causing blur.

One solution would be to replace the image after scaling, then you have a completely new UIImage at full resolution.



[self.view setFrame:reallyBigFrame];
[self.view setImage:newUIImage];

      

The other one will initially host the UIImage at its full size 293x184 UIImageView and then use AffineTransform to scale it:

view.transform = CGAffineTransformScale(view.transform, 0.25, 0.25);

      

0


a source







All Articles