1 GDI+的核心:Graphics类
(1)The Graphics class provides methods for drawing lines, curves, figures, images, and text. A Graphics object stores attributes of the display device and attributes of the items to be drawn.【msdn】
Graphics是一个device context和你的drawing conetent之间的一个中介。它存储了device context的相关属性,以及drawing content的属性。这样,它就能用自己的方法把drawing content“映射”到device content 之上。
(2)GDI+的核心是Graphics类,包含了显示、绘图等功能。它提供了四个构造函数:
Graphics::Graphics(Image*)
Graphics::Graphics(HDC)
Graphics::Graphics(HDC,HANDLE)
Graphics::Graphics(HWND,BOOL)
构造函数1从image对象创建一个Graphics类。这种方式允许你在打开某张,或者生成某张位图之后,应用Grapgics的方法对改位图进行操作。
构造函数2从一个传统的HDC获取一个Graphics对象,把传统的在HDC完成的操作接手过来。也就是当要画直线,曲线,图

GDI+的核心是Graphics类,提供绘制线条、曲线、图像和文本等方法。Graphics对象存储设备上下文和绘制内容的属性,作为两者之间的桥梁。通过不同的构造函数,如Graphics::Graphics(Image*)和Graphics::Graphics(HDC),可以创建Graphics实例进行绘图操作。GDI+相较于传统GDI编程,简化了对象创建和管理,支持更丰富的颜色和Unicode字符串,提升了编程体验。
654

被折叠的 条评论
为什么被折叠?



