stone
stone

Reputation: 2202

NSImageView rending a blurry NSimage despite it being of the same size

I have an NSCollectionViewItem with an NSImageView (32x32) to which i supply a @1x image of the same size.

It looks perfect in the interface builder, but when the app is built, the resolution looks quite off. Is there any particular reason for this?

enter image description here

Just to add that the Image in the asset manager also has a @2x

enter image description here

EDIT: Still investigating this issue, but I have just noticed that If the collection view which contains the collection item, which contains the NSImageView is enclosed by a bordered NSSCrollView the images are perfect (.ie non blurry)

Upvotes: 1

Views: 102

Answers (1)

stone
stone

Reputation: 2202

Turns out if you draw images in frames with either the x,y coords or the height and width having fractions you end up with blurry images. passing the drawingRect through NSIntegralRect fixes that.

Upvotes: 1

Related Questions