欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#使用Region對圖形區(qū)域構(gòu)造和填充的方法

 更新時間:2015年06月12日 14:52:57   作者:zhuzhao  
這篇文章主要介紹了C#使用Region對圖形區(qū)域構(gòu)造和填充的方法,實(shí)例分析了Region類圖形操作的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了C#使用Region對圖形區(qū)域構(gòu)造和填充的方法。分享給大家供大家參考。具體如下:

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 Form15 : Form
  {
    public Form15()
    {
      InitializeComponent();
    }
    private void Form15_Paint(object sender, PaintEventArgs e)
    {
      GraphicsPath myPath = new GraphicsPath();
      string stringText = "zhuzhao";
      FontFamily family = new FontFamily("Arial");
      int fontStyle = (int)FontStyle.Italic;
      int emSize = 26;
      Point origin = new Point(20, 20);
      StringFormat format = StringFormat.GenericDefault;
      myPath.AddString(stringText,family,fontStyle,emSize,origin,format);
      Region region = new Region(myPath);
      e.Graphics.FillRegion(Brushes.Red, region);
    }
  }
}

希望本文所述對大家的C#程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論