public override void Draw(RenderTarget rt) { var b = ContentView.GetSBrush(0.8f, 0.2f, 0.5f); var b1 = ContentView.GetSBrush(0.4f, 0.4f, 0.4f); var b2 = ContentView.GetSBrush(0f, 0f, 0f); var b4 = ContentView.GetSBrush(0.1f, 0.1f, 0.1f); base.Draw(rt); rt.FillRectangle(ContentView.Scaled(ContentBounds), b1); rt.DrawRectangle(ContentView.Scaled(ContentBounds), b2, 1); rt.FillEllipse(new Ellipse(ContentView.Scaled(OUT.Position), ContentView.Scaled(0.1f), ContentView.Scaled(0.1f)), b); var DWFactory = new SharpDX.DirectWrite.Factory(SharpDX.DirectWrite.FactoryType.Shared); SharpDX.DirectWrite.TextFormat tf = new SharpDX.DirectWrite.TextFormat(DWFactory, "Arial", ContentView.Scaled(0.6f)); var tg = ContentView.Scaled(ContentBounds); tg.Left += 2; tg.Top += 2; rt.DrawText(Name, tf, tg, b4); tg.Top += ContentView.Scaled(ContentBounds.Height / 2); rt.DrawText(Delay.ToString(), tf, tg, b4); tf.Dispose(); DWFactory.Dispose(); b.Dispose(); b1.Dispose(); b2.Dispose(); b4.Dispose(); }
public G_Pin(G_Component owner, string name) : base(name) { Owner = owner; Direction = Direction.Up; RodBrush = ContentView.GetSBrush(0.2f, 0.2f, 0.2f); RingBrush = ContentView.GetSBrush(0.3f, 0.3f, 0.3f); RingBrush_Pointed = ContentView.GetSBrush(0.1f, 0.33f, 0.5f); OnMouseDownEvent += G_Pin_OnMouseDownEvent; }
public override void Draw(RenderTarget rt) { var b = ContentView.GetSBrush(0.2f, 0.2f, 0.2f); base.Draw(rt); if (Selected) { rt.DrawRectangle(ContentView.Scaled(AreaBounds), b, 1f, ContentView.DashedStroke); //边框 } b.Dispose(); }