Number of screen pixels

Posted by mucaman on June 30, 2001

I need a function to know how many pixels the screen has. I mean a need to put a Delphi form in coordinates related to total screen size regardless the resolution (640x480, 800x600, 1024x768).

Does anyone can help?

Re: webmaster Guido on July 04, 2001

Every Delphi project contains a global variable Screen, that is automatically created, and that is of the type TScreen (search in the Help files for "TScreen").

To get the resolution, use Screen.Width and Screen.Height. These are the resolution settings of the monitor of a single-monitor system, or of the "primary" monitor of a multi-monitor system.

If you foresee that some users may have multi-monitor systems, look up the Help info on Screen.MonitorCount, Screen.Monitors (Screen.Monitors[0] is the primary monitor, Screen.Monitors[1] is the second one, and so on...), TScreen.DesktopWidth, TScreen.DesktopHeight and more.


DelphiLand Discussion Forum