Delphi Procedures and Function Library > Information > Introduction

Sometimes it isn't necessary to declare new class when you need simple routine to find out the number of available system colors... Of course you could create TAdvancedCanvas class with new appropriate method, but wont it be easier to write small function like this?

function GetSysColorsNumber(Canvas: TCanvas): LongInt;
  Result := (LongInt(1) shl GetDeviceCaps(Canvas.Handle, BitsPixel))
              *LongInt(GetDeviceCaps(Canvas.Handle, Planes)); 

DPFL is a "Delphi procedures and functions library". It's storage of small but useful code pieces waiting for you to use them. If you want to participate - you are welcome, if you want just to use - you still are. Read these rules though just to be aware of them.
All DPFL's programming code is free and provided to you as is. Generally functions and procedures are belong to their authors and provided by them into the public domain.
If you'll find here something originally written by you please write us and your name will be mentioned in the code comments.

Advertising on Torry's Delphi Pages