• 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: Resolution of an NSImage(Rep)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resolution of an NSImage(Rep)?


  • Subject: Re: Resolution of an NSImage(Rep)?
  • From: Brian Postow <email@hidden>
  • Date: Thu, 5 Aug 2010 10:57:28 -0400

On Aug 5, 2010, at 10:48 AM, Graham Cox wrote:

>
> On 06/08/2010, at 12:39 AM, Brian Postow wrote:
>
>> ([img size].width / [rep pixelWidth]) * 72
>
>
> and that should be:-
>
> [rep pixelWidth] * 72.0 / [img size].width;
>
> Your formula is inverted, and you should multiply before dividing to get best precision.
>

good points.

But... um,  then how do i fix my imgsize? this nsimage is  sometimes coming from a PDFPage with:

	NSData* imgData = [pg dataRepresentation];
	NSImage* img = [[NSImage alloc] initWithData:imgData ];
is there a better way to get the data out of the PDFPage?

Other times, it's coming from either a TIFF file, or raw bitmap data from a scanner.

> --Graham

Brian Postow
Senior Software Engineer
Acordex Imaging Systems

_______________________________________________

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

  • Follow-Ups:
    • Re: Resolution of an NSImage(Rep)?
      • From: Brian Postow <email@hidden>
    • Re: Resolution of an NSImage(Rep)?
      • From: Graham Cox <email@hidden>
References: 
 >Resolution of an NSImage(Rep)? (From: Brian Postow <email@hidden>)
 >Re: Resolution of an NSImage(Rep)? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: calling a function in one class from another
  • Next by Date: Re: Resolution of an NSImage(Rep)?
  • Previous by thread: Re: Resolution of an NSImage(Rep)?
  • Next by thread: Re: Resolution of an NSImage(Rep)?
  • Index(es):
    • Date
    • Thread