使用PathGradientBrush类
来源:互联网 发布:matlab数组写入excel 编辑:程序博客网 时间:2024/06/05 03:45
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Point centerPoint = new Point(160, 80);
int R = 60;
GraphicsPath path = new GraphicsPath();
path.AddEllipse(centerPoint.X - R, centerPoint.Y - R, 2 * R, 2 * R);
PathGradientBrush brush = new PathGradientBrush(path);
//指定路径中心点
brush.CenterPoint = centerPoint;
//指定路径中心点的颜色
brush.CenterColor = Color.White;
//Color类型的数组指定与路径上每个顶点对应的颜色
brush.SurroundColors = new Color[] { Color.Black };
g.FillEllipse(brush, centerPoint.X - R, centerPoint.Y - R, 2 * R, 2 * R);
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Point centerPoint = new Point(160, 80);
int R = 60;
GraphicsPath path = new GraphicsPath();
path.AddEllipse(centerPoint.X - R, centerPoint.Y - R, 2 * R, 2 * R);
PathGradientBrush brush = new PathGradientBrush(path);
//指定路径中心点
brush.CenterPoint = centerPoint;
//指定路径中心点的颜色
brush.CenterColor = Color.White;
//Color类型的数组指定与路径上每个顶点对应的颜色
brush.SurroundColors = new Color[] { Color.Black };
g.FillEllipse(brush, centerPoint.X - R, centerPoint.Y - R, 2 * R, 2 * R);
}
}
}
- 使用PathGradientBrush类
- PathGradientBrush
- 学习使用PathGradientBrush的小程序
- GDI+ PathGradientBrush OutOfMemoryException
- C# PathGradientBrush 处理颜色渐渐变
- GDI+ for VCL基础 -- 画刷之PathGradientBrush
- 使用类
- 使用类
- handler使用--HandlerThread类,Bundle的使用
- 线程池使用及CountDownLatch类使用
- 什么时候使用抽象类, 什么时候使用接口 ?
- ThinkPHP使用 上传类UploadFile的使用
- fastjson使用(二) -- JSON类的使用
- NAudio使用之BlockAlignReductionStream类使用疑惑
- 修饰类的使用以及使用技巧
- 模板类的使用- 简单使用
- c++ libcurl使用(使用类)
- CRectTracker类的使用
- UML类图与对象图
- 使用LinearGradientBrush类
- 用例图
- ASP.NET如何让后台代码控制div层显示及隐藏
- 状态图与活动图
- 使用PathGradientBrush类
- wince文件存储及文件管理器(二)
- Android 自定义旋转进度框(单帧)
- 绘制文字,。说明:该文字由图片充填,图片自己找
- Wiki OI 1044 拦截导弹
- 构串操作符#和合并操作符##的用法
- .编写一个Windows应用程序,由给定数据25,15,10,30,20饼图
- hdu1251统计难题(字典树小试牛刀)
- Linux开启mysql远程连接的设置步骤