Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSImageView + Background Color

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,

like image 674
Amitg2k12 Avatar asked Jul 29 '11 07:07

Amitg2k12


1 Answers

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...

like image 99
Joshua Nozzi Avatar answered Sep 21 '22 14:09

Joshua Nozzi