Home » Articles

Graphics Programming Techniques

3 March 2016 No Comment by jawad

All delphi  applications use the graphics unit , which provides classes such as pen, brush, font  canvas and related declarations.

This article covers some  classes and these are advanced graphic techniques such as bitmaps graphic  files and how to create drag and drop objects.

Graphic class relationships.

When you first begin to design your graphical program  you may be unsure  whether to use the image and or the the shape components  or an object of the  picture class. To decide on  the best course for your program. First understand the relationships  among the following classes.

Canvas as mentioned this class provides a painting  surface on which you can  draw and paint graphics by calling methods  and assigning property values.You  never create a stand alone canvas object you will always use this class as the canvas property of another object such asa the paintbox  or a  form.

T graphic:  This class is the immediate ancestor for  the bitmap, icon and metafile classes. You never create a standalone graphic object.

Instead you  use this class as a parameter data type or as component property. You may assign a bitmap, icon or a  metafile object to any graphic parameter variable or property.

graphic control: This component class is the ancestor  for the graphical   component  classes T-speedbutton, T-tabbutton( used  by the  Tabbed notebook component) T shape  T-paintbox, T-image and T-custom label( the immediate ancestor to label the graphic control class provides a canvas which  for example a speed button uses to display its bitmap. You will probably not need T-graphic control in application development. It is valuable  mostly for writing visual components that do not  have associated  window and therefore  take less memory than components that serve as interfaces for standard  window elements such  a buttons and check boxes . The control unit ( not graphics) declares Tgraphic control.

Leave your response!

You must be logged in to post a comment.