Posts

Showing posts from March, 2019

Customized Printing in Delphi

Image
Delphi provides modern full text and graphics printing facility. We can print texts, images and shapes in different formats by using several Delphi classes and members. We can also access printers installed on system and can change their properties Print and printer setup dialog in Delphi. Delphi provides TPrintDialog and TPrinterSetupDialog components to confirm printing and to set printer properties. Delphi also provides Printer  object which provides functions to access printers details and to print any text or image on canvas. In this blog I will show how to use TPrintDialog and TPrinterSetUpDialog. I will also explain with examples on how to print TRichedit text, how to print TListView data and how to print custom data on Printer.Canvas . Using Print dialog and Printer Setup dialog It is a good practice that we display the printer dialog so that user can control printing. We will show a print dialog that allows the user to select all pages, or a range of pages. We ca...

Drawing Shapes in Delphi

Image
Believe me, drawing shapes in Delphi is so easy. To develop a software like CAD, Paint, CorelDraw Delphi provides large number of classes and members that supports to draw shapes on a form or on a graphic control. In Delphi, we draw shapes on canvas of a form or graphic controls. Canvas is an area of form where we can draw shapes, lines and can fill colors on shapes. In Delphi, every form or graphic controls have Canvas property which provides TCanvas object that can be used to draw shapes. TPen object is used to draw lines and we can set size, color of lines. TBrush object is used to set color and style to fill the shapes. Most frequently used classes for drawing shapes are TCanvas , TBitmap, TGraphics, TPen, TBrush TCanvas Use TCanvas as a drawing surface for objects that draw an image of themselves TBitmap   Bitmap is a powerful graphics object used to create, manipulate (scale, scroll, rotate, and paint), and store images in memory and as files on a disk....