zoukankan      html  css  js  c++  java
  • (C#)GDI+简单绘图画多边形

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace _10._2._2
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Form1_Paint(object sender, PaintEventArgs e)
            {
                Graphics g = e.Graphics;
                Brush brush = new SolidBrush(Color.Yellow);
                Pen pen = new Pen(Color.Green,8);
                Point[] points1 =
                {
                    new Point(10,90),
                    new Point(40,300),
                    new Point(200,78)
                };
                g.DrawPolygon(pen, points1);
                Point[] points2 =
                {
                    new Point(110,90),
                    new Point(140,300),
                    new Point(300,78)
                };
                g.FillPolygon(brush, points2);
            }
        }
    }
    

    利用Point数组画图。
  • 相关阅读:
    Fragment入门代码
    Handler注意事项
    Handler处理消息
    Handler发送消息
    Hander创建消息
    handler四元素
    handler方法
    Handle的特点
    handler定义
    9Patch图
  • 原文地址:https://www.cnblogs.com/finlay/p/3234762.html
Copyright © 2011-2022 走看看