Drawing Existing Objects
Listing 9.1 shows how EasyDraw uses its DataSet and the DataTable it contains to draw graphical objects. The program begins by declaring several variables used for storing and drawing objects. The objects m_DataSet and m_DataTable contain the current picture’s data. When the program needs to load or save a picture, it uses the m_DataSet object’s ReadXml and WriteXml methods. Rows in the table m_DataTable represent the picture’s drawing objects. The program declares m_DataTable using the WithEvents keyword so it can easily receive events for that object.
Subroutine DrawDataSet draws the objects represented by a DataSet. The routine’s first parameter is the Graphics object on which it should draw. The program must draw ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access