VC plotting tools, colors, and plotting Functions

Source: Internet
Author: User
Tags polyline

1. Paint Brush

There are two ways to create a paint brush

First, call the getstockobject () function directly.

Second, you can call it by creating a paint brush.

Hpen createpen (
Int
Fnpenstyle , // Pen style
Int Nwidth , // Pen width
Colorref Crcolor // Pen color
);

After creating a paint brush, you must call the SelectObject function to select the device environment;

You can use the deleteobject function to delete a paint brush;

2. Image painter

Create a paint brush

First, call the getstockobject function.

The second is to create a paint brush by calling createsolidbrush and createhatchbrush.

   hbrush createsolidbrush (colorref   crcolor  // brush color value  );   
Hbrush createhatchbrush (intFnstyle,// Hatch StyleColorrefClrref// Color value); 
 
3. Color
Implemented through RGB functions;
 
4. Commonly Used plotting Functions
 
Sets the current position of the paint brush function movetoex.
   bool movetoex (HDC   HDC  , // handle to device context  int   x  , // X-coordinate of New Current Position  int   Y  , // y-coordinate of New Current Position lppoint // pointer to old current position );   
  the lineto function that draws a straight line from the current position to the specified coordinate point  
   bool lineto (HDC   HDC  , // device context handle  int   nxend  , // X-coordinate of line's ending point  int   nyend  // y-coordinate of line's ending point  );   
    Start from the current position and use a line segment to connect to the polyline function of each point specified in lppoints  
   bool polyline (HDC   HDC  , // handle to device context  const point   * lppt  ,  // pointer to array containing endpoints  int   cpoints  // number of points in the array  );   
Elliptical Arc
 Bool arc (HDC  HDC  , // Handle to device context Int  Nleftrect  , // X-coord of bounding rectangle's upper-left corner Int  Ntoprect , // Y-coord of bounding rectangle's upper-left corner Int  Nrightrect  , // X-coord of bounding rectangle's lower-right corner Int  Nbottomrect  , // Y-coord of bounding rectangle's lower-right corner Int  Nxstartarc  , // First radial ending pointInt  Nystartarc  , // First radial ending point Int  Nxendarc  , // Second radial ending point Int  Nyendarc // Second radial ending point );  
Draw a pie chart and fill the pie with the current paint brush
 Bool pie (HDC  HDC  , // Handle to device context Int  Nleftrect  , // X-coord of bounding rectangle's upper-left corner Int  Ntoprect , // Y-coord of bounding rectangle's upper-left corner Int  Nrightrect  , // X-coord of bounding rectangle's lower-right corner Int  Nbottomrect  , // Y-coord of bounding rectangle's lower-right corner Int  Nxradial1  , // X-coord of first radial's endpointInt  Nyradial1  , // Y-coord of first radial's endpoint Int  Nxradial  , // X-coord of second radial's endpoint Int  Nyradial // Y-coord of second radial's endpoint );   
Draw a rectangle and fill the rectangle
 Bool rectangle (HDC  HDC  , // Handle to device context Int  Nleftrect  , // X-coord of bounding rectangle's upper-left corner Int  Ntoprect , // Y-coord of bounding rectangle's upper-left corner Int  Nrightrect  , // X-coord of bounding rectangle's lower-right corner Int  Nbottomrect // Y-coord of bounding rectangle's lower-right corner );  
 
Draw an ellipse and fill Ellipse
Bool ellipse (HDC  HDC  , // Handle to device context Int  Nleftrect  , // X-coord of bounding rectangle's upper-left corner Int  Ntoprect  , // Y-coord of bounding rectangle's upper-left corner Int  Nrightrect , // X-coord of bounding rectangle's lower-right corner Int  Nbottomrect // Y-coord of bounding rectangle's lower-right corner );  
 
Draw a polygon and fill it with polygon
   bool polygon (HDC   HDC  , // handle to device context  const point   * lppoints  ,  // pointer to Polygon's vertices  int   ncount  // count of Polygon's vertices  );   
  the invalidaterect function is used to refresh the user zone (to make the region invalid)  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.