NSImage *image = [imageView image];     //IBOutlet to ImageView
NSSize imageSize = [image size];
NSLog(@"Height: %f, Width: %f", imageSize.height, imageSize.width);

This number stayed the same for me regardless of the scaling and matched the 
dimensions specified in the Finder.
 
On Jan 14, 2010, at 12:46 AM, cocoa-dev-requ...@lists.apple.com wrote:

> Hello all.
> I want to get the actual size of the NSImage which I dragged into an 
> NSImaveView that has the imageScaling to NSImageScaleProportionallyUpOrDown.
> 
> I have found some answers on the web, but it seems Im still missing 
> something, or those answer don't apply to me.. On of them was to create a 
> Category of NSImageCell and there add a method like this
> 
> 
> @implementation NSImageCell  (XWSImageCellCategory); 
> 
> -(NSRect)rectCoveredByImageInBounds:(NSRect) bounds{
>       return [super  imageRectForBounds:bounds];
> }
> 
> 
> I have done that.. but Im getting still the size of the NSImageView.
> 
> I dunno if  Im missing something in my Custom NSImageView, overriding some 
> method, but I don't see what might help me.
> 
> Thanks a lot
> 
> Best Regards
> 
> Gustavo Pizano

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to