C#画笔Pen绘制光滑模式曲线的方法
更新时间:2015年06月12日 09:06:15 作者:zhuzhao
这篇文章主要介绍了C#画笔Pen绘制光滑模式曲线的方法,涉及C#图形绘制画笔Pen相关属性的设置技巧,需要的朋友可以参考下
本文实例讲述了C#画笔Pen绘制光滑模式曲线的方法。分享给大家供大家参考。具体实现方法如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace WindowsApplication2
{
public partial class Form11 : Form
{
public Form11()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.Empty, Color.Empty, 100);
ColorBlend blend = new ColorBlend();
blend.Colors = new Color[] { Color.Red, Color.Green, Color.Blue };
blend.Positions = new float[] { 0, .5f, 1 };
brush.InterpolationColors = blend;
Pen pen5 = new Pen(brush);
Graphics g5 = this.CreateGraphics();
Point[] p = new Point[] { new Point(0, 0), new Point(100, 100), new Point(50, 100), new Point(200, 100) };
g5.SmoothingMode = SmoothingMode.AntiAlias;
g5.DrawCurve(pen5,p);
}
}
}
希望本文所述对大家的C#程序设计有所帮助。
相关文章
浅谈C#下winform和JS的互相调用和传参(webbrowser)
下面小编就为大家带来一篇浅谈C#下winform和JS的互相调用和传参(webbrowser)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧2016-12-12
Unity AssetPostprocessor模型函数Model实用案例深入解析
这篇文章主要为大家介绍了Unity AssetPostprocessor模型Model函数实用案例深入解析,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪2023-05-05
c#异步操作后台运行(backgroundworker类)示例
这篇文章主要介绍了c#异步操作后台运行(backgroundworker类)示例,需要的朋友可以参考下2014-04-04
C#使用文件流FileStream和内存流MemoryStream操作底层字节数组byte[]
这篇文章介绍了C#使用文件流FileStream和内存流MemoryStream操作底层字节数组byte[]的方法,文中通过示例代码介绍的非常详细。对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2022-05-05


最新评论