• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: image arithmetic
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image arithmetic


  • Subject: Re: image arithmetic
  • From: "email@hidden" <email@hidden>
  • Date: Wed, 10 Nov 2010 14:06:52 +0000

On 10 Nov 2010, at 14:00, Amy Gibbs wrote:

> Hi all,
>
> that fixes my null  issue, thanks, I can't believe I didn't see that.
>
> I still can't work out how to get the original height and width of my image though, I'm trawling through google searches for nsimage and size etc but nothing seems to work I get various error messages,
>
> while ((imgPath = [imageLoop nextObject])) {
> 			NSImage *img = [[NSImage alloc]initWithContentsOfFile:imgPath];
> 			float imgsize = [img bounds].size.height;
>
> 			float scalefactor = 225 /imgsize ;
>
>
NSImage doesn't respond to -bounds (NSImageView does). You should have got a warning about this.
Try NSImage -size

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >image arithmetic (From: Amy Gibbs <email@hidden>)
 >Re: image arithmetic (From: Amy Gibbs <email@hidden>)

  • Prev by Date: Re: Detecting reading a key in KVC
  • Next by Date: Re: Detecting reading a key in KVC
  • Previous by thread: Re: image arithmetic
  • Next by thread: NSObject as Viewcontroller
  • Index(es):
    • Date
    • Thread