views:

569

answers:

1

I have one app, a UIImage*.

I'm painting the image twice:

Once in a table cell, which I'm drawing manually for performance reasons, so it's getting pained with [image drawInRect:CGRect..];

The 2nd time it's in a UIImageView.

The image is approx 3x the size of the rect I'm painting in.
Both the UIImageView frame and the passed rect are the exact same dimension.
The UIImageView is set to scale to fill.

When painting with drawInRect I get a nicely scaled image.
When it gets painted by the UIImageView within a XIB, it gets scaled horribly (pixelated, doesn't look good).

I guess there is a way to apply a scaling filter, but I don't set it before calling drawInRect, and there's no option to set it for the UIImageView in IB.

What do I have to do to get the same nice picture in the UIImageView?

+1  A: 

I just found this link, which is full of interesting information about manipulating image display -- I'm not sure if any of it will help you, but it can't hurt...

Amagrammer
I'm positive about the frame sizes, they are exactly the same. What I meant in difference is after scaling, I'm not sure if AA is the right word to use, but the problem is that the UIImageView applies a not-so-good looking filter when resizing the image.
Prody
@your edit, I think setting the interpolation quality is exactly what I need. Thanks
Prody
You are quite welcome. I just discovered the interpolation settings a few days ago myself. Interesting thing about developing for a new technology -- we learn together as we go.
Amagrammer