7

I have requirement like this,

Have One NSIMageView and which will be changing frequently on the timer basis, On resizing, it needs to maintain the aspect ratio, so Image may not occupy the entire frame of the Image, in such case, i need to display the background color black,

can anyone help me how can i achieve that, On googling got one approach is to have SubClass of NSImageView, but no idea, what will impact on the performance, as image is changing frequently,

Amitg2k12
  • 3,765
  • 10
  • 48
  • 97

1 Answers1

10

Set the image view's sizing mode to Proportionate. Enclose it in an NSBox set to Custom mode with a black background. No code needed, just a case of thinking inside the box...

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135