首页 > 代码库 > GDI+(Graphics Device Interface)

GDI+(Graphics Device Interface)

1创建画布(创建Graphics对象)

Bitmap bitmap = new Bitmap(80,80);

Graphics g=Graphics.FromImage(bitmap);

2创建Pen对象(直线 曲线)

public Pen = new Pen(Color.Black);

Pen pen= new Pen(Color.Black,5);

SolidBrush brush= new SolidBrush(Color.Red);

Pen pen = new Pen(brush);

Pen pen = new Pen(Brush,5);

3创建Brush对象(画刷)

几种类型

SolidBrush 纯色画刷

HatBrush从预设图案中选择绘制.

TextureBrush 纹理绘制

LinearGradientBrush: 使用沿渐变混合的两种颜色进行绘制

PathGradientBrush:基于编程者定义的唯一路径,使用负载的混合色渐变进行绘制.

 

GDI+(Graphics Device Interface)