Question: How can I reliably print an image to the printer? Answer: Sending a bitmap based on the screen to the printer is an invalid operation that will usually fail, unless the print driver has been designed to detect this error condition and compensate for the error. This means you should use the VCL canvas [...]
Archive for the ‘Delphi’ Category
12 Feb
Control Panel Applets
How To Create Control Panel Applet ? Creating a Control Panel Applet is a straight forward process. Simply create a Dynamic Link Library with the extension of .cpl (Control Panel Library) and place it in the Windows system directory. Each cpl file can support multiple control panel applets. The cpl will have a single function [...]
11 Feb
Allow your Delphi Forms to Accept Dropped Files from Window Explorer
Drag and drop operations are commonly used operations in Windows applications. When working with Window Explorer you can copy, move and even delete files by using drag and drop. Moving an object with the mouse button pressed is usually called dragging, and what happens when we end dragging by releasing the mouse button is called [...]
10 Feb
How to Retrieve the Users Current IP address using Delphi code
In this tutorial you will learn how to retrieve the users current IP address using Delp hi code. You can use this method in a variety of network applications or internet utilities. If you would like to learn how to retrieve the user IP address follow the steps below. Make sure to add this code [...]
10 Feb
Printing With Richedit
James V. Bacus <bacuslab@mcs.net> I have written a program that collects information that a user selects, by a number of checkboxes and buttons, to a non visible RichEdit box. The program was written under Windows 95 and works fine. But under NT 4.0 the line … RichEdit1.Print(”); returns a Divide by Zero Error. The only [...]
10 Feb
Direct Write to Network Printer
unit Rawprint; interface uses printers,windows; type TRawprinter =class(TPrinter) public dc2 : HDC; aborted : boolean; printing : boolean; lasttime : integer; procedure abort; function startraw : boolean; function endraw: boolean; function write(s : string): boolean; function writeln: boolean; destructor destroy; override; procedure settimer; function printerror : boolean; end; implementation uses sysutils,forms,dialogs,controls; procedure TRawPrinter.settimer; begin lasttime:=gettickcount; [...]
20 Jan
Print Preview Rich Edit
// r : Destination Rectangle (on Preview or Printer Canvas) // XInch : Width in Inch of rectangle to print // YInch : Height in Inch of rectangle to print // xalign,yalign : Alignment in horizontal and vertical direction tRichEditAlign = (rTop,rBottom,rCentered); procedure PrintRichEdit(RichEdit : tMyRichEdit; Canvas : tCanvas; r : tRect; XInch,YInch : extended; [...]
20 Jan
Rich Edit Print Preview
// r : Destination Rectangle (on Preview or Printer Canvas) // XInch : Width in Inch of rectangle to print // YInch : Height in Inch of rectangle to print // xalign,yalign : Alignment in horizontal and vertical direction tRichEditAlign = (rTop,rBottom,rCentered); procedure PrintRichEdit(RichEdit : tMyRichEdit; Canvas : tCanvas; r : tRect; XInch,YInch : extended; [...]
20 Jan
Controlling Margins when printing RichEdit contents
Printing from a RichEdit is really rather easy – all you need to do is to call the Print method: RichEdit1.Print(const Caption: string); The Caption parameter shown here specifies the title that appears in the Print queue. Therefore you would, for example, call something like: RichEdit1.Print(MyAppName+’: ‘+DocumentTitle); From this call the system will carefully format [...]

Komentar Terbaru