GDI+编程基础(1)

从GDI+所包含的内容来看,它主要由以下几方面构成:

二维几何图形的处理 

    矢量图形由图元(如直线、曲线和轮廓等)组成,图元由坐标中的一组点来制定。GDI+的Rectangele类用于存储一个矩形的位置和尺寸;Pen类存储了线条颜色、线宽和线条风格的信息;Graphics类拥有用于绘制直线、矩形及其他图形的方法;还有几个Brush类存储了怎么用颜色来填充闭合图形和路径。

 

显示图像

    用于存储位图信息的数据结构比用于存储矢量图形所要求的数据结构更为复杂。所以,在GDI+中就有几个类用于处理这些复杂的位图信息。

 

排版

    排版与使用各种各样的字体、尺寸和风格显示的文本有关。GDI+为一复杂的任务提供了大量的函数来完善各种不同的风格的文本输出。

 

To create a graphics object

  • Receive a reference to a graphics object as part of the PaintEventArgs in the Paint event of a form or control. This is usually how you obtain a reference to a graphics object when creating painting code for a control.

    -or-

  • Call the CreateGraphics method of a control or form to obtain a reference to a Graphics object that represents the drawing surface of that control or form. Use this method if you want to draw on a form or control that already exists.

    -or-

  • Create a Graphics object from any object that inherits from Image. This approach is useful when you want to alter an already existing image.

    The following sections give details about each of these processes.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值