日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

winform手绘Step步骤进度节点线条图

發(fā)布時(shí)間:2024/3/26 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 winform手绘Step步骤进度节点线条图 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

? ?

void drawStep(Panel panel1)
? ? ? ? {

? ? ? ? ? ? int[] rowHeights = new int[] { 100, 200, 80, 40 };
? ? ? ? ? ? ///直徑
? ? ? ? ? ? int rectLenth = 20;

? ? ? ? ? ? Graphics graphics = panel1.CreateGraphics();


? ? ? ? ? ? graphics.SmoothingMode = SmoothingMode.AntiAlias; ?//使繪圖質(zhì)量最高,即消除鋸齒
? ? ? ? ? ? graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
? ? ? ? ? ? graphics.CompositingQuality = CompositingQuality.HighQuality;

? ? ? ? ? ? int lenTotal = 0;

? ? ? ? ? ? //繪制中線
? ? ? ? ? ? graphics.Clear(Color.LightYellow);
? ? ? ? ? ? Color c = new Color();
? ? ? ? ? ? c = Color.Black;
? ? ? ? ? ? for (int i = 0; i < rowHeights.Length; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? int rowHeight = rowHeights[i];
? ? ? ? ? ? ? ? lenTotal += rowHeight;

? ? ? ? ? ? ? ? int x1 = panel1.Width / 2;
? ? ? ? ? ? ? ? int y1 = 0;
? ? ? ? ? ? ? ? int x2 = x1;
? ? ? ? ? ? ? ? int y2 = rowHeight;

? ? ? ? ? ? ? ? int rectX = x1 - rectLenth / 2;

? ? ? ? ? ? ? ? int rectsemi = rectLenth / 2;

? ? ? ? ? ? ? ? int rectY = rowHeight / 2 - rectLenth / 2;

? ? ? ? ? ? ? ? if (i == 0)
? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? c = Color.Red;

? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? {


? ? ? ? ? ? ? ? ? ? y1 = lenTotal - rowHeight;

? ? ? ? ? ? ? ? ? ? y2 = lenTotal;

? ? ? ? ? ? ? ? ? ? c = Color.Black;


? ? ? ? ? ? ? ? ? ? rectY = y1 + rowHeights[i] / 2 - rectsemi;
? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? graphics.DrawLine(new Pen(c, 5), x1, y1, x2, y2);


? ? ? ? ? ? ? ? graphics.FillEllipse(new SolidBrush(c),
? ? ? ? ? ? ? ? ? ? ? ? ? new Rectangle(new Point(rectX, rectY),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? new Size(rectLenth, rectLenth)));
? ? ? ? ? ? }
? ? ? ? }

?

剛發(fā)現(xiàn)個(gè)現(xiàn)象,用Alt鍵時(shí)繪的圖居然消息了,要放在paint事件中,就不會了

總結(jié)

以上是生活随笔為你收集整理的winform手绘Step步骤进度节点线条图的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。