• 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: Screen Resolution and Screen Size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Screen Resolution and Screen Size


  • Subject: Re: Screen Resolution and Screen Size
  • From: Lance Saleme <email@hidden>
  • Date: Tue, 22 Nov 2005 13:13:59 -0800

	// SAMPLE CODE FOR EXTRACTING MONITOR SIZES
	NSArray *screenArray	= [NSScreen screens];
	NSScreen *mainScreen	= [NSScreen mainScreen];
	unsigned screenCount	= [screenArray count];
	unsigned index			= 0;

	for (index; index < screenCount; index++)
	{
		NSScreen *screen	= [screenArray objectAtIndex: index];
		NSRect screenRect	= [screen visibleFrame];
		NSString *mString	= ((mainScreen == screen) ? @"Main" : @"not-main");

NSLog(@"Screen #%d (%@) Frame: %@", index, mString, NSStringFromRect (screenRect));
}


Enjoy,
Lance


On Nov 22, 2005, at 1:02 PM, Gerd Knops wrote:


On Tue, Nov 22, at 1:27 AM, j o a r wrote:


On 22 nov 2005, at 08.20, m wrote:

Docs say that NSScreen's displayDescription method returns a dictionary that is supposed to have an entry (key: NSDeviceResolution) that describes the device's pixel density. You should be able to back calculate the screen's physical dimensions from that and the pixel dimensions.

Yes, if it weren't for the fact (?) that it _always_ returns 72 dpi [*].


I think that the bottom line is that Apple _can't_ provide this information, because it _can't_ get it from the monitor. At least I'm pretty sure that it wouldn't be possible for CRT and VGA monitors. Perhaps it would be possible using LCD+DVI, I don't know enough to say for sure.

When we needed it way back then for OneVision on NeXTSTEP we ended up adding a calibration preference screen that would show a box of a certain pixel size, had the user measure it with a ruler and enter the result...


Gerd

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40computecture.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Screen Resolution and Screen Size
      • From: Lance Saleme <email@hidden>
References: 
 >Screen Resolution and Screen Size (From: Rolando Sacramento <email@hidden>)
 >Re: Screen Resolution and Screen Size (From: j o a r <email@hidden>)
 >Re: Screen Resolution and Screen Size (From: m <email@hidden>)
 >Re: Screen Resolution and Screen Size (From: j o a r <email@hidden>)
 >Re: Screen Resolution and Screen Size (From: Gerd Knops <email@hidden>)

  • Prev by Date: Re: Screen Resolution and Screen Size
  • Next by Date: Re: Screen Resolution and Screen Size
  • Previous by thread: Re: Screen Resolution and Screen Size
  • Next by thread: Re: Screen Resolution and Screen Size
  • Index(es):
    • Date
    • Thread