1

I'm developing an iOS 4 application.

This question is related to UIImageView, setClipsToBounds and how my images are losing their head

I have the following problem:

On an UITableViewCell I have an UIImageView. This UIImageView is 77x77px and will hold differents images size.

I must to process those images in this way:

If an image is 100x120, I need to remove from pixel 78 to pixel 100 (on width), and 78 to 120 (on height). Another option is to create another one cuting out those pixels.

How can I do that?

Community
  • 1
  • 1
VansFannel
  • 45,055
  • 107
  • 359
  • 626

1 Answers1

1

Try to set contentMode of the image view to UIViewContentModeTopLeft.

Hope it will help.

Martin Pilch
  • 3,245
  • 3
  • 38
  • 61
  • 1
    But, it image's width is less than UIImageView width (or the same width height), how can I scale image? Thanks for your answer. – VansFannel Mar 29 '12 at 07:28
  • i have thought you want to cut out (crop) the image, not to resize. So as @Lukas pointed out use UIViewContentModeScaleAspectFit – Martin Pilch Mar 29 '12 at 09:07