zoukankan      html  css  js  c++  java
  • GDI+

    1.GDI+命名空间:System.Drawng.  System.Drawng.Text. System.Printing. System.Drawing.Imaging. System.Draming.Drawing2D。 System.Drawing.Design

    一       .Graphics(画板)对象,

          创建graphics的方法:1.利用窗体或控件的Paint事件的参数PaintEventArgs:

    Private void Form1_Paint(object sender,System.EventArgs e)

    {

          Graphics g=e.Graphics;

    }

    2.  s使用窗体或控件的CreateGraphics的方法,用于对想一存在的情况下:

      Graphics g;

      g=this.CreateGraphics();

    3.LinearGradientBrush(颜色渐变画刷)

        linearGradientBrush ff=new LinearGradientBrush(new Point(),new Point(),Color.red,Color,Blue)

    4.Font 建立之后不能修改 必须重新建立新的对象。

       常用属性:  Bold  Italic  Regular,Strikeout,Underline

    三。画椭圆

                 Graphics g = e.Graphics;
                 Pen p = new Pen(Color.Red, 20);
                 g.DrawEllipse(p, 1, 2, 50, 30);
                 Rectangle r = new Rectangle(52, 25, 136, 40);
                 g.DrawEllipse(p, r);

                 画多边形:

      Graphics g = e.Graphics;
                Pen p = new Pen(Color.Red, 20);
                g.DrawEllipse(p, 1, 2, 50, 30);
                 Rectangle r = new Rectangle(52, 25, 136, 40);
                 g.DrawEllipse(p, r);
                 Point p1 = new Point(50, 50);
                 Point p2 = new Point(15, 50);

                 Point p3 = new Point(150, 50);

                 Point p4 = new Point(120, 50);
                 Point p5 = new Point(25, 50);
                 Point p6 = new Point(50, 65);
                 Point[] curvePont = {p1,p2,p3,p4,p5 };
                 g.DrawPolygon(p, curvePont);

    二。Pen对象的创建的方式

      1, Pen p1=new Pen(Color);

    2.Pen p2=new Pen(Brush);

    3Pen p3=new Pen(Brush,float);带宽度刷子

    4.Pen p4=new Pen(Color,Red);颜色和像

    三。Brush对象(画刷)  用来填充图形,是抽象类,不能实例化,只能使用它派生

    1.  SolidBrush(单色画刷)

           SolidBrush ff=new SolidBrush(Color.red)

           2.HatchBrush(阴影画刷)

                 HatchStyle ff = new HatchStyle(HatchStyle.Cross, Color.Blue, Color.Red);

  • 相关阅读:
    看看别人实现的投影触控技术
    SharePoint (MOSS2007) 中 实现Form 验证全部(转载)
    XPath简明教程
    做人,做事,做架构师 转载 潘爱民 文章
    Java不适合于作为主要编程教学语言 孟岩
    KenaBoy的provider模式(转载)
    愚老先生的 WSS3.0 Lists服务的使用方法,帮了大忙
    Provider模式(转载)
    没有配置aspnetdb的情况下Membership的默认存储方式
    【ASP.NET开发】.NET三层架构简单解析 分类: ASP.NET 20130116 18:05 1568人阅读 评论(0) 收藏
  • 原文地址:https://www.cnblogs.com/czsl/p/2752837.html
Copyright © 2011-2022 走看看