How to Stretch an Icon

Posted December 15th @ 9:09 pm by m3Rlin

Although Delphi’s StretchDraw() function should work for icons it doesn’t The way to get round this is to use the Windows API DrawIconEx() function.

(* iNewWidth - (Integer) New icon width
** iNewHeight - (Integer) New icon height
*)
DrawIconEx(Canvas.Handle, 0, 0, Icon.Handle, iNewWidth, iNewHeight, 0, 0, DI_NORMAL);

How to Print Text

Posted December 15th @ 9:01 pm by m3Rlin

This is the harder way to print text in Delphi If you want to do it the easier way check out tip 4.1. Well, if for some reasons you may want to print using the Windows API here’s the code:
Code 1:

uses
Printers, WinSpool;

var
aDriver, aPort, aPrinterName: array[0..255] of Char; { aDriver and [...]

« Previous EntriesNext Entries »