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#逐行分元素讀取記事本數(shù)據(jù)并寫入數(shù)據(jù)庫的方法
這篇文章主要介紹了C#逐行分元素讀取記事本數(shù)據(jù)并寫入數(shù)據(jù)庫的方法,通過StreamReader類里的ReadLine()方法實現(xiàn)逐行讀取的功能,是非常實用的技巧,需要的朋友可以參考下2014-12-12
Unity編輯器選擇器工具類Selection常用函數(shù)示例詳解
這篇文章主要為大家介紹了Unity編輯器選擇器工具類Selection常用函數(shù)示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-08-08
C#?利用Autofac批量接口注入依賴的問題小結(jié)
這篇文章主要介紹了C#?利用Autofac批量接口注入依賴的問題,本文給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-12-12

