windows序设计07.pptVIP

  • 1
  • 0
  • 约5.34千字
  • 约 21页
  • 2017-05-15 发布于贵州
  • 举报
windows序设计07

Windows绘图 董本志 * 3 边界框函数 下面我想讨论的是Arc函数,它绘制椭圆曲线。然而,如果不先讨论一下Ellipse函数,那么Arc函数将难以理解;而如果不先讨论Rectangle函数,那么Ellipse函数又将难以理解;而如果讨论Ellipse和Rectangle函数,那么我又会讨论RoundRect、Chord和Pie函数。 问题在于,Rectangle、Ellipse、RoundRect、Chord和Pie函数严格来说不是画线函数。没错,这些函数是在画线,但它们同时又填入画刷填入一个封闭区域。这个画刷内定为白色,因此当您第一次使用这些函数时,您可能不会注意到它们不只是画线。严格地说,这些函数属于后面「填入区域」的小节,不过,我还是在这里讨论它们。 上面提到的函数有一个共同特性,即它们都是依据一个矩形边界框来绘图的。 BOOL Rectangle( HDC hdc, // handle to DC int nLeftRect, // x-coord of upper-left corner of rectangle int nTopRect, // y-coord of upper-left corner of rectangle int nRightRect, // x-coord of lower-right corner of rectangle int nBottomRect // y-coord of lower-right corner of rectangle ); //绘制矩形 BOOL Ellipse( HDC hdc, // handle to DC int nLeftRect, // x-coord of upper-left corner of rectangle int nTopRect, // y-coord of upper-left corner of rectangle int nRightRect, // x-coord of lower-right corner of rectangle int nBottomRect // y-coord of lower-right corner of rectangle ); //绘制椭圆 BOOL RoundRect( HDC hdc, // handle to DC int nLeftRect, // x-coord of upper-left corner of rectangle int nTopRect, // y-coord of upper-left corner of rectangle int nRightRect, // x-coord of lower-right corner of rectangle int nBottomRect, // y-coord of lower-right corner of rectangle int nWidth, // width of ellipse int nHeight // height of ellipse ); //绘制圆角矩形 BOOL Arc( HDC hdc, // handle to device context int nLeftRect, // x-coord of rectangles upper-left corner int nTopRect, // y-coord of rectangles upper-left corner int nRightRect, // x-coor

文档评论(0)

1亿VIP精品文档

相关文档