How to Determine the Screen Resolution

Posted December 15th @ 9:14 pm by m3Rlin

There are two ways to determine the screen’s height and width.
1) Use the global Screen variable.

uses
Forms;

Screen.Height { Screen height in pixels }
Screen.Width { Screen width in pixels }

2) Use the Windows API GetSystemMetrics() function. This function can be useful in applications that don’t use the VCL like [...]

How to Convert TColor to a Hex String and Vice Versa

Posted December 15th @ 9:12 pm by m3Rlin

Delphi uses TColor to represent colors but HTML requires a string name (139 colors have names in the web palette) or a hex number. Here’s the code to convert a TColor color value to hex a string and vise versa.
The functions use the Windows API GetRValue(), GetBValue(), GetGValue() and RGB() functions.
!Note: If your are going [...]

« Previous Entries