Commit 3976e0dd HZH

控件透明

1 个父辈 f3c18196
...@@ -296,6 +296,7 @@ namespace HZH_Controls.Controls ...@@ -296,6 +296,7 @@ namespace HZH_Controls.Controls
base.OnPaint(e); base.OnPaint(e);
var g = e.Graphics; var g = e.Graphics;
g.SetGDIHigh(); g.SetGDIHigh();
base.Region = new Region(m_path);
g.FillPath(new SolidBrush(arrowColor), m_path); g.FillPath(new SolidBrush(arrowColor), m_path);
......
...@@ -616,6 +616,7 @@ namespace HZH_Controls.Controls.Conduit ...@@ -616,6 +616,7 @@ namespace HZH_Controls.Controls.Conduit
break; break;
#endregion #endregion
} }
base.Region = new Region(path);
g.FillPath(new SolidBrush(conduitColor), path); g.FillPath(new SolidBrush(conduitColor), path);
//渐变色 //渐变色
......
...@@ -247,14 +247,20 @@ namespace HZH_Controls.Controls ...@@ -247,14 +247,20 @@ namespace HZH_Controls.Controls
var rectRight = new Rectangle(m_workingRect.Right - conveyorHeight + 5, (inclination >= 0 ? (m_workingRect.Top) : (m_workingRect.Bottom - conveyorHeight)) + 5, conveyorHeight - 10, conveyorHeight - 10); var rectRight = new Rectangle(m_workingRect.Right - conveyorHeight + 5, (inclination >= 0 ? (m_workingRect.Top) : (m_workingRect.Bottom - conveyorHeight)) + 5, conveyorHeight - 10, conveyorHeight - 10);
g.FillEllipse(new SolidBrush(conveyorColor), rectRight); g.FillEllipse(new SolidBrush(conveyorColor), rectRight);
g.FillEllipse(new SolidBrush(Color.White), new Rectangle(rectRight.Left + (rectRight.Width - 6) / 2, rectRight.Top + (rectRight.Height - 6) / 2, 6, 6)); g.FillEllipse(new SolidBrush(Color.White), new Rectangle(rectRight.Left + (rectRight.Width - 6) / 2, rectRight.Top + (rectRight.Height - 6) / 2, 6, 6));
//传送带 //传送带
//左端 //左端
GraphicsPath path = new GraphicsPath(); GraphicsPath path = new GraphicsPath();
path.AddArc(new Rectangle(m_workingRect.Left, (inclination >= 0 ? (m_workingRect.Bottom - conveyorHeight) : m_workingRect.Top), conveyorHeight, conveyorHeight), 90F - (float)inclination, 180F); GraphicsPath pathRegion = new GraphicsPath();
path.AddArc(new Rectangle(m_workingRect.Left + 3, (inclination >= 0 ? (m_workingRect.Bottom - conveyorHeight) : m_workingRect.Top) + 3, conveyorHeight - 6, conveyorHeight - 6), 90F - (float)inclination, 180F);
pathRegion.AddArc(new Rectangle(m_workingRect.Left, (inclination >= 0 ? (m_workingRect.Bottom - conveyorHeight) : m_workingRect.Top), conveyorHeight, conveyorHeight), 90F - (float)inclination, 180F);
//右端 //右端
path.AddArc(new Rectangle(m_workingRect.Right - conveyorHeight, (inclination >= 0 ? (m_workingRect.Top) : (m_workingRect.Bottom - conveyorHeight)), conveyorHeight, conveyorHeight), 270 - (float)inclination, 180F); path.AddArc(new Rectangle(m_workingRect.Right - conveyorHeight + 3, (inclination >= 0 ? (m_workingRect.Top) : (m_workingRect.Bottom - conveyorHeight)) + 3, conveyorHeight - 6, conveyorHeight - 6), 270 - (float)inclination, 180F);
pathRegion.AddArc(new Rectangle(m_workingRect.Right - conveyorHeight, (inclination >= 0 ? (m_workingRect.Top) : (m_workingRect.Bottom - conveyorHeight)), conveyorHeight, conveyorHeight), 270 - (float)inclination, 180F);
path.CloseAllFigures(); path.CloseAllFigures();
base.Region = new System.Drawing.Region(pathRegion);
g.DrawPath(new Pen(new SolidBrush(conveyorColor), 3), path); g.DrawPath(new Pen(new SolidBrush(conveyorColor), 3), path);
//液体流动 //液体流动
......
...@@ -2016,7 +2016,7 @@ ...@@ -2016,7 +2016,7 @@
this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Name = "UCTestBtns"; this.Name = "UCTestBtns";
this.Size = new System.Drawing.Size(635, 793); this.Size = new System.Drawing.Size(993, 793);
this.Load += new System.EventHandler(this.UCTestBtns_Load); this.Load += new System.EventHandler(this.UCTestBtns_Load);
this.ucControlBase1.ResumeLayout(false); this.ucControlBase1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
......
...@@ -37,9 +37,11 @@ ...@@ -37,9 +37,11 @@
this.ucConduit7 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit7 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit6 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit6 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit3 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit3 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit4 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit2 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit2 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit18 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit18 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit17 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit17 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit1 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit19 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit19 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit20 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit20 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit21 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit21 = new HZH_Controls.Controls.Conduit.UCConduit();
...@@ -54,11 +56,9 @@ ...@@ -54,11 +56,9 @@
this.ucConduit26 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit26 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit5 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit5 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit10 = new HZH_Controls.Controls.Conduit.UCConduit(); this.ucConduit10 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucConduit1 = new HZH_Controls.Controls.Conduit.UCConduit();
this.ucBottle1 = new HZH_Controls.Controls.UCBottle(); this.ucBottle1 = new HZH_Controls.Controls.UCBottle();
this.ucPond2 = new HZH_Controls.Controls.UCPond(); this.ucPond2 = new HZH_Controls.Controls.UCPond();
this.ucBlower4 = new HZH_Controls.Controls.UCBlower(); this.ucBlower4 = new HZH_Controls.Controls.UCBlower();
this.ucConduit4 = new HZH_Controls.Controls.Conduit.UCConduit();
this.SuspendLayout(); this.SuspendLayout();
// //
// ucValve1 // ucValve1
...@@ -181,6 +181,19 @@ ...@@ -181,6 +181,19 @@
this.ucConduit3.Size = new System.Drawing.Size(496, 37); this.ucConduit3.Size = new System.Drawing.Size(496, 37);
this.ucConduit3.TabIndex = 40; this.ucConduit3.TabIndex = 40;
// //
// ucConduit4
//
this.ucConduit4.ConduitColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucConduit4.ConduitStyle = HZH_Controls.Controls.Conduit.ConduitStyle.Horizontal_None_Up;
this.ucConduit4.ConduitWidth = 50;
this.ucConduit4.LiquidColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(169)))), ((int)(((byte)(243)))));
this.ucConduit4.LiquidDirection = HZH_Controls.Controls.Conduit.LiquidDirection.Backward;
this.ucConduit4.LiquidSpeed = 50;
this.ucConduit4.Location = new System.Drawing.Point(935, 313);
this.ucConduit4.Name = "ucConduit4";
this.ucConduit4.Size = new System.Drawing.Size(87, 37);
this.ucConduit4.TabIndex = 39;
//
// ucConduit2 // ucConduit2
// //
this.ucConduit2.ConduitColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.ucConduit2.ConduitColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
...@@ -220,6 +233,19 @@ ...@@ -220,6 +233,19 @@
this.ucConduit17.Size = new System.Drawing.Size(37, 134); this.ucConduit17.Size = new System.Drawing.Size(37, 134);
this.ucConduit17.TabIndex = 37; this.ucConduit17.TabIndex = 37;
// //
// ucConduit1
//
this.ucConduit1.ConduitColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucConduit1.ConduitStyle = HZH_Controls.Controls.Conduit.ConduitStyle.Horizontal_None_None;
this.ucConduit1.ConduitWidth = 50;
this.ucConduit1.LiquidColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(169)))), ((int)(((byte)(243)))));
this.ucConduit1.LiquidDirection = HZH_Controls.Controls.Conduit.LiquidDirection.Backward;
this.ucConduit1.LiquidSpeed = 50;
this.ucConduit1.Location = new System.Drawing.Point(581, 194);
this.ucConduit1.Name = "ucConduit1";
this.ucConduit1.Size = new System.Drawing.Size(136, 37);
this.ucConduit1.TabIndex = 52;
//
// ucConduit19 // ucConduit19
// //
this.ucConduit19.ConduitColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.ucConduit19.ConduitColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
...@@ -402,19 +428,6 @@ ...@@ -402,19 +428,6 @@
this.ucConduit10.Size = new System.Drawing.Size(161, 37); this.ucConduit10.Size = new System.Drawing.Size(161, 37);
this.ucConduit10.TabIndex = 47; this.ucConduit10.TabIndex = 47;
// //
// ucConduit1
//
this.ucConduit1.ConduitColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucConduit1.ConduitStyle = HZH_Controls.Controls.Conduit.ConduitStyle.Horizontal_None_None;
this.ucConduit1.ConduitWidth = 50;
this.ucConduit1.LiquidColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(169)))), ((int)(((byte)(243)))));
this.ucConduit1.LiquidDirection = HZH_Controls.Controls.Conduit.LiquidDirection.Backward;
this.ucConduit1.LiquidSpeed = 50;
this.ucConduit1.Location = new System.Drawing.Point(581, 194);
this.ucConduit1.Name = "ucConduit1";
this.ucConduit1.Size = new System.Drawing.Size(136, 37);
this.ucConduit1.TabIndex = 52;
//
// ucBottle1 // ucBottle1
// //
this.ucBottle1.BottleColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59))))); this.ucBottle1.BottleColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
...@@ -468,19 +481,6 @@ ...@@ -468,19 +481,6 @@
this.ucBlower4.Size = new System.Drawing.Size(116, 154); this.ucBlower4.Size = new System.Drawing.Size(116, 154);
this.ucBlower4.TabIndex = 62; this.ucBlower4.TabIndex = 62;
// //
// ucConduit4
//
this.ucConduit4.ConduitColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucConduit4.ConduitStyle = HZH_Controls.Controls.Conduit.ConduitStyle.Horizontal_None_Up;
this.ucConduit4.ConduitWidth = 50;
this.ucConduit4.LiquidColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(169)))), ((int)(((byte)(243)))));
this.ucConduit4.LiquidDirection = HZH_Controls.Controls.Conduit.LiquidDirection.Backward;
this.ucConduit4.LiquidSpeed = 50;
this.ucConduit4.Location = new System.Drawing.Point(935, 313);
this.ucConduit4.Name = "ucConduit4";
this.ucConduit4.Size = new System.Drawing.Size(87, 37);
this.ucConduit4.TabIndex = 39;
//
// UCTestConduit // UCTestConduit
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!