欧美特黄不卡,涩涩视频在线,成人国产精品一区二区网站,亚洲一区二区三区欧美

當前位置:雨林木風下載站 > 技術開發教程 > 詳細頁面

一個畫任意形狀的窗體的例子

一個畫任意形狀的窗體的例子

更新時間:2022-05-10 文章作者:未知 信息來源:網絡 閱讀次數:

繼承System.Windows.Forms.Form窗體類時,重載其畫窗體形狀的事件OnPaint,就可以畫出各種自定義的窗體形狀。例子代碼是畫一個圓形窗體。
protected override void OnPaint(PaintEventArgs e)
{
GraphicsPath gp = new GraphicsPath();
gp.AddEllipse(20,20,110,110);
//gp.AddLine(30,30,110,110);
 
Matrix RotationTransform = new Matrix(1,0, 0,1,1,1);// rotation matrix
//Matrix TranslationTransform = new Matrix(1, 0, 0, 1, 0, 0); // translation matrix
PointF TheRotationPoint = new PointF(110.0f, 110.0f);// rotation point 
// rotate the rotation transformation matrix f degrees around TheRotationPoint
RotationTransform.RotateAt(f, TheRotationPoint); 
//Call the Transform method of the Graphics Path in order to multiply it by the rotation matrix and rotate the balloon
gp.Transform(RotationTransform);
e.Graphics.DrawPath(Pens.Black, gp);
f=f+10;
this.Region=new Region(gp);//這句是很重要的,設定窗體顯示的區域為你所畫的區域。
}

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

主站蜘蛛池模板: 鞍山市| 淳安县| 崇信县| 宁津县| 博湖县| 景德镇市| 凤阳县| 卓资县| 凤阳县| 宜城市| 贡山| 新和县| 三门县| 黑龙江省| 鄂托克前旗| 建瓯市| 徐水县| 小金县| 东台市| 福海县| 崇明县| 和龙市| 呼玛县| 宁远县| 林西县| 缙云县| 卫辉市| 左贡县| 龙游县| 长海县| 仙游县| 盱眙县| 乌恰县| 南江县| 平乐县| 交城县| 青海省| 马鞍山市| 手机| 光山县| 仲巴县|