Currently, the graphic interface is popular in the world, rather than text. Therefore, in software development, you must draw a picture, for example, simply draw a line and draw some special images. For example, if you want to draw a moving clock, you need to constantly draw seconds and minutes. Movetoex is used to move the current position of the paint brush, and lineto is used to draw a straight line. In fact, the linear display in computer graphics uses the principle of grating graphics. The movetoex and lineto functions are declared as follows: Wingdiapi bool winapi movetoex (_ in HDC, _ in int X, _ in int y, _ out_opt lppoint lppt ); HDCIs the handle of the current device. XIt is the position of the X axis and the horizontal direction. Generally, the origin is the position in the upper left corner of the screen. YIs the position of the Y axis, vertical direction. LpptIs the Coordinate Position before moving. Wingdiapi bool winapi lineto (_ in HDC, _ in int X, _ in int y ); HDCIs the handle of the current device. XIt is the position of the X axis and the horizontal direction. Generally, the origin is the position in the upper left corner of the screen. YIs the position of the Y axis, vertical direction. An example of calling this function is as follows: #001 // #002 // The output is displayed on the interface. #003 // #004 // Cai junsheng 2007/09/08 QQ: 9073204 Shenzhen #005 // #006 void ccaiwinmsg: ondraw (HDC) #007 { #008 // move to the specified location. #009 point ptlefttop; #010 ptlefttop. x = 10; #011 ptlefttop. Y = 10; #012 movetoex (HDC, ptlefttop. X, ptlefttop. Y, null ); #013 #014 // draw a straight line from (10, 10) to (100,100. #015 ptlefttop. x = 100; #016 ptlefttop. Y = 100; #017 lineto (HDC, ptlefttop. X, ptlefttop. y ); #018 #019} |