C#模式畫刷HatchBrush用法實例
更新時間:2015年06月11日 15:05:47 作者:zhuzhao
這篇文章主要介紹了C#模式畫刷HatchBrush用法,實例分析了模式畫刷HatchBrush繪圖的相關(guān)技巧,需要的朋友可以參考下
本文實例講述了C#模式畫刷HatchBrush用法。分享給大家供大家參考。具體如下:
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 Form7 : Form
{
public Form7()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
HatchBrush hat = new HatchBrush(HatchStyle.Divot, Color.DarkBlue, Color.White);
Graphics formGraphics = this.CreateGraphics();
formGraphics.FillRectangle(hat, new RectangleF(90.0F, 110.0F, 100, 100));
formGraphics.Dispose();
}
catch (System.IO.FileNotFoundException)
{
MessageBox.Show("There was an error opening the bitmap." + "Please check the path.");
}
}
private void Form7_Load(object sender, EventArgs e)
{
}
}
}
希望本文所述對大家的C#程序設(shè)計有所幫助。
相關(guān)文章
C#如何讀寫應(yīng)用程序配置文件App.exe.config,并在界面上顯示
這篇文章主要介紹了C#如何讀寫應(yīng)用程序配置文件App.exe.config,并在界面上顯示問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-06-06
Unity?AssetPostprocessor模型函數(shù)Model實用案例深入解析
這篇文章主要為大家介紹了Unity?AssetPostprocessor模型Model函數(shù)實用案例深入解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-05-05

