PaintEventArgs in the Paint Event Handler The following sections give details about each of these processes. This approach is useful when you want to alter an already existing image. Use this method if you want to draw on a form or control that already exists.Ĭreate a Graphics object from any object that inherits from Image. Similarly, you can also obtain a graphics object as a property of the PrintPageEventArgs when handling the PrintPage event for a PrintDocument.Ĭall the CreateGraphics method of a control or form to obtain a reference to a Graphics object that represents the drawing surface of that control or form. This is usually how you obtain a reference to a graphics object when creating painting code for a control. Receive a reference to a graphics object as part of the PaintEventArgs in the Paint event of a form or control. Using the Graphics object to draw lines and shapes, render text, or display and manipulate images.Ī graphics object can be created in a variety of ways. There are two steps in working with graphics: The Graphics object represents a GDI+ drawing surface, and is the object that is used to create graphical images. Before you can draw lines and shapes, render text, or display and manipulate images with GDI+, you need to create a Graphics object.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |