C#圖形區(qū)域剪切的實現(xiàn)方法
更新時間:2015年06月12日 16:07:28 作者:zhuzhao
這篇文章主要介紹了C#圖形區(qū)域剪切的實現(xiàn)方法,涉及C#圖形操作的相關(guān)技巧,需要的朋友可以參考下
本文實例講述了C#圖形區(qū)域剪切的實現(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 advanced_drawing
{
public partial class Form16 : Form
{
public Form16()
{
InitializeComponent();
}
private void Form16_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
GraphicsPath path = new GraphicsPath();
path.AddEllipse(this.ClientRectangle);
Region regoin = new Region(path);
g.DrawPath(Pens.Red, path);
g.Clip = regoin;
Rectangle rect = this.ClientRectangle;
rect.Offset(10, 10);
rect.Width -= 20;
rect.Height -= 20;
g.FillRectangle(Brushes.Black, rect);
g.DrawString("zhuzhao", this.Font, Brushes.Blue, 100, 100);
}
}
}
希望本文所述對大家的C#程序設(shè)計有所幫助。
您可能感興趣的文章:
相關(guān)文章
C#?form-data上傳圖片流到遠程服務(wù)器的詳細代碼
這篇文章主要介紹了C#?form-data上傳圖片流到遠程服務(wù)器的詳細代碼,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-08-08

