C#紋理畫刷TextureBrush用法實例
更新時間:2015年06月11日 14:58:47 作者:zhuzhao
這篇文章主要介紹了C#紋理畫刷TextureBrush用法,實例分析了紋理畫刷TextureBrush的具體使用技巧,需要的朋友可以參考下
本文實例講述了C#紋理畫刷TextureBrush用法。分享給大家供大家參考。具體如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void Form6_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
try
{
Bitmap image1 = (Bitmap)Image.FromFile(@"E:/ico/Administrator.bmp", true);
TextureBrush texture = new TextureBrush(image1);
texture.WrapMode = System.Drawing.Drawing2D.WrapMode.TileFlipX;
Graphics formGraphics = this.CreateGraphics();
formGraphics.FillEllipse(texture, 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.");
}
}
}
}
希望本文所述對大家的C#程序設(shè)計有所幫助。
相關(guān)文章
C#并發(fā)編程之a(chǎn)sync和await關(guān)鍵字詳解
對于?async?和?await?兩個關(guān)鍵字,對于一線開發(fā)人員再熟悉不過了,到處都是它們的身影,下面小編就來和大家記錄匯總下它們的使用吧2023-07-07
C#常用多線程(線程同步,事件觸發(fā),信號量,互斥鎖,共享內(nèi)存,消息隊列)
這篇文章主要介紹了C#常用多線程(線程同步,事件觸發(fā),信號量,互斥鎖,共享內(nèi)存,消息隊列),本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-09-09
C#使用JavaScriptSerializer序列化時的時間類型處理
這篇文章主要為大家詳細介紹了C#使用JavaScriptSerializer序列化時的時間類型處理,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-08-08

