C#從畫刷創(chuàng)建畫筆的方法
更新時間:2015年06月11日 15:43:20 作者:zhuzhao
這篇文章主要介紹了C#從畫刷創(chuàng)建畫筆的方法,涉及C#圖形繪制的基本技巧,需要的朋友可以參考下
本文實例講述了C#從畫刷創(chuàng)建畫筆的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:
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.DrawEllipse(pen5, 0, 0, 100, 100);
}
}
}
希望本文所述對大家的C#程序設(shè)計有所幫助。
相關(guān)文章
C#創(chuàng)建數(shù)據(jù)庫及導(dǎo)入sql腳本的方法
這篇文章主要介紹了C#創(chuàng)建數(shù)據(jù)庫及導(dǎo)入sql腳本的方法,涉及C#針對數(shù)據(jù)庫的創(chuàng)建、連接、導(dǎo)入等相關(guān)操作技巧,需要的朋友可以參考下2015-12-12
C# JSON格式化轉(zhuǎn)換輔助類 ConvertJson
本文介紹使用C#原生代碼實現(xiàn) JSON格式化以及各種類型轉(zhuǎn)化JSON的輔助類,幫助開發(fā)人員快速開發(fā)。2016-04-04
利用C#實現(xiàn)將小數(shù)值四舍五入為整數(shù)
在項目的開發(fā)中,遇到一些除法計算內(nèi)容會產(chǎn)生小數(shù)值,但是又需要根據(jù)項目的實際情況將這些小數(shù)內(nèi)容化為整數(shù),所以本文為大家整理了C#實現(xiàn)將小數(shù)值四舍五入為整數(shù)的方法,希望對大家有所幫助2023-07-07

