Skip to main content

How to: Use a Drawing Tool. 02/15/2019; 4 minutes to read +2; In this article. The Image Editor has freehand drawing and erasing tools that all work in the same way. You select the tool and, if necessary, select foreground and background colors and size and shape options. You then move the pointer to the image and click or drag to draw and erase.

Examples. The following example creates a horizontal LinearGradientBrush; the color components change linearly as you move from a horizontal coordinate of 0 to a horizontal coordinate of 200.For example, a point whose first coordinate is halfway between 0 and 200 will have a blue component that is halfway between 0 and 255.

The following method demonstrates how to use the Pens class. This example is designed to be used with Windows Forms. Paste the code into a form and call the UsePensClass method when handling the form's Paint event, passing e as PaintEventArgs. private: void UsePensClass( PaintEventArgs^ e ) { e ...

Examples. The following code example prints the file named C:\My Documents\MyFile.txt on the default printer. To run the example, create a new Windows Forms project and paste the example code into the form, replacing the file contents.

Examples. The following code example shows how to use the Bitmap(Int32, Int32, Int32, PixelFormat, IntPtr) constructor. This example is designed to be used with Windows Forms and requires a PaintEventArgs parameter, which is a parameter of the Paint event.. private void BitmapConstructorEx(PaintEventArgs e) { // Create a bitmap.