• Graphics in Delphi
  • Drawing on a Form
  • T w e n t y t w o graphics in Delphi




    Download 1.85 Mb.
    Pdf ko'rish
    bet1/58
    Sana09.05.2023
    Hajmi1.85 Mb.
    #57944
      1   2   3   4   5   6   7   8   9   ...   58
    Bog'liq
    GraphicsinDelphi md6



    Copyright ©1999 SYBEX, Inc., Alameda, CA. www.sybex.com
    www.sybex.com


    C H A P T E R
    T W E N T Y - T W O
    Graphics in Delphi

    Painting on a form

    Animated buttons

    An image viewer

    Drawing over a bitmap

    Graphical grids and games

    Using TeeChart

    Windows metafiles
    22
    Copyright ©1999 SYBEX, Inc., Alameda, CA. www.sybex.com
    www.sybex.com


    4
    I
    n Chapter 6 of Mastering Delphi 5, I introduced the Canvas object, Windows
    painting process, and the OnPaint event. In this bonus chapter, I’m going to start
    from this point and continue covering graphics, following a number of different
    directions. (For all the code discussed here and in Mastering Delphi 5, check the
    Sybex Web site.)
    I’ll start with the development of a complex program to demonstrate how the
    Windows painting model works. Then I’ll focus on some graphical components,
    such as graphical buttons and grids. During this part of the chapter we’ll also add
    some animation to the controls.
    Finally, this chapter will discuss the use of bitmaps, covering some advanced
    features for fast graphics rendering, metafiles, the TeeChart component (including
    its use on the Web), and few more topics related to the overall issue of graphics.
    Drawing on a Form
    In Chapter 6, we saw that it is possible to paint directly on the surface of a form in
    response to a mouse event. To see this behavior, simply create a new form with
    the following OnMouseDown event handler:
    procedure TForm1.FormMouseDown(Sender: TObject;
    Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

    Download 1.85 Mb.
      1   2   3   4   5   6   7   8   9   ...   58




    Download 1.85 Mb.
    Pdf ko'rish