开发者

IKImageView resize is blocky

开发者 https://www.devze.com 2022-12-24 22:34 出处:网络
I am putting an image into an IKImageView, and immediately sizing it to fit. Whenever I do this, the image originally appears at 1-1 size (huge) and then resizes down, which would be fine if the anima

I am putting an image into an IKImageView, and immediately sizing it to fit. Whenever I do this, the image originally appears at 1-1 size (huge) and then resizes down, which would be fine if the animation was smooth. However, the animation looks ... fluttery? There are big blocks, like 2 inches square, of the image that appear and shrink independently of each other. The effect is a little annoying, and almost to the level where it might give an epileptic a seizure... (I'm exaggerating a little).

Is this a bug in IKImageView? Is it a bug in the animation? Will it go away if I turn off the animation (How do I do that? setAnimates: NO doesn't seem to do anything, nor does overloading animates to return NO in my subclass...

EDIT: addedcode:

NSImage* image = [doc currentImage];
[imageVi开发者_运维技巧ew setImage: image];
[imageView zoomImageToFit: self];

This is in the app controller, so self is the application (or plugin, depending on which version I'm looking at)


If you tell the IKImageView to autoresize, then it won't animate the new image to the new size and the artefacts will not be a problem. The image will be sized to fit in the image view immediately.

imageView.autoresizes = YES;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号