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 [...]

How to Set the Length of a String

Posted December 15th @ 7:01 pm by m3Rlin

The string length is automatically set but sometimes you want to change the length yourself. That’s because sometimes you have to have the same length of a string every time (when saving to binary files). You can always use the string[n] (ShortString) type but their maximum length is 256 characters.
!!Note: You CAN NOT set the [...]

« Previous EntriesNext Entries »