• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Pad类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Pad的典型用法代码示例。如果您正苦于以下问题:C# Pad类的具体用法?C# Pad怎么用?C# Pad使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Pad类属于命名空间,在下文中一共展示了Pad类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Paint

 public override void Paint(Pad pad, double minX, double maxX, double minY, double maxY)
 {
     base.Paint(pad, minX, maxX, minY, maxY);
     if (string.IsNullOrWhiteSpace(Text))
         return;
     var size = pad.Graphics.MeasureString(Text, TextFont);
     var w = size.Width;
     var h = size.Height;
     var clientX = pad.ClientX(X);
     var clientY = pad.ClientY(Y);
     var point = PointF.Empty;
     switch (TextPosition)
     {
         case ETextPosition.RightTop:
             point = new PointF(clientX + TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.LeftTop:
             point = new PointF(clientX - w - TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.CentreTop:
             point = new PointF(clientX - w/2 - TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.RightBottom:
             point = new PointF(clientX + TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
         case ETextPosition.LeftBottom:
             point = new PointF(clientX - w - TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
         case ETextPosition.CentreBottom:
             point = new PointF(clientX - w/2 - TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
     }
     pad.Graphics.DrawString(Text, TextFont, new SolidBrush(TextColor), point.X, point.Y);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:34,代码来源:TLabel.cs


示例2: PadProperyForm

 public PadProperyForm(object obj, Pad pad)
 {
     InitializeComponent();
     this.obj = obj;
     this.pad = pad;
     Text = string.Format("{0}  properties", obj.GetType().Name);
 }
开发者ID:28427328,项目名称:SQCharts,代码行数:7,代码来源:PadProperyForm.cs


示例3: BackgroundIntoBitmapIfNeeded

 private void BackgroundIntoBitmapIfNeeded(Pad pad, Bitmap bm)
 {
     if (this.Look != EChartLook.SurfaceOnly)
         return;
     var g = Graphics.FromImage(bm);
     TView.View(pad).PaintAxes(g, pad, 0, 0, this.H);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:7,代码来源:TFunction.cs


示例4: TLegend

 public TLegend(Pad pad)
 {
     Pad = pad;
     BorderEnabled = true;
     BorderColor = Color.Black;
     BackColor = Color.LightYellow;
     Items = new ArrayList();
 }
开发者ID:28427328,项目名称:SQCharts,代码行数:8,代码来源:TLegend.cs


示例5: LineView

 public LineView(DrawingLine line, Pad pad)
 {
     this.line = line;
     this.pad = pad;
     this.toolTipEnabled = true;
     this.toolTipFormat = "{0} {1} {2} - {3:F6}";
     this.chartFirstDate = new DateTime(Math.Min(line.X1.Ticks, line.X2.Ticks));
     this.chartLastDate = new DateTime(Math.Max(line.X1.Ticks, line.X2.Ticks));
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:9,代码来源:LineView.cs


示例6: TestFuncAssigning

  public void TestFuncAssigning() {
    Pad src = new Pad ("src", PadDirection.Src);
    src.GetCapsFunction = new PadGetCapsFunction (PadGetCapsStub);

    Caps caps = src.Caps;

    Assert.IsNotNull (caps, "Ooops, returned caps is null");
    Assert.IsFalse (caps.IsEmpty == true, "Ooops, returned caps are empty");
    Assert.AreEqual ("video/x-raw-yuv", caps.ToString ());
  }
开发者ID:jwzl,项目名称:ossbuild,代码行数:10,代码来源:PadTest.cs


示例7: GetRightStick

 //What is the value of the right analog stick
 public static Vector2 GetRightStick(Pad pad, int player)
 {
     switch(pad) {
         case Pad.XB:
             return new Vector2(Input.GetAxis(FormatAxis("XB","RS","X",player)), (Input.GetAxis(FormatAxis("XB","RS","Y",player)) * -1));
         case Pad.PS:
             return new Vector2(Input.GetAxis(FormatAxis("PS","RS","X",player)), (Input.GetAxis(FormatAxis("PS","RS","Y",player)) * -1));
     }
     return Vector2.zero;
 }
开发者ID:newgrounds,项目名称:PointCounterpoint,代码行数:11,代码来源:GamePad.cs


示例8: ReleaseButton

 //Return the input for the game's catch
 public static bool ReleaseButton(Pad pad, int player)
 {
     //Debug.Log("Catch Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKeyUp(FormatJoystick(player,17));//xbox B button
         case Pad.PS:
             return Input.GetKeyUp(FormatJoystick(player,8));//PS L2 button
     }
     return false;
 }
开发者ID:newgrounds,项目名称:PointCounterpoint,代码行数:12,代码来源:GamePad.cs


示例9: LeftButton

 //Return the input for left on the dpad
 public static bool LeftButton(Pad pad, int player)
 {
     //Debug.Log("Left Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKey(FormatJoystick(player,7));//xbox D AXIS
         case Pad.PS:
             return Input.GetKey(FormatJoystick(player,7));//PS left button
     }
     return false;
 }
开发者ID:newgrounds,项目名称:PointCounterpoint,代码行数:12,代码来源:GamePad.cs


示例10: JumpButton

 //Return the input for the game's jump button
 public static bool JumpButton(Pad pad, int player)
 {
     //Debug.Log("Jump Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKey(FormatJoystick(player,16));//xbox A button
         case Pad.PS:
             //Debug.Log("Get Button X is " + Input.GetButton("A_1"));
             return Input.GetKey(FormatJoystick(player,14));
     }
     return false;
 }
开发者ID:newgrounds,项目名称:PointCounterpoint,代码行数:13,代码来源:GamePad.cs


示例11: PadAddElement

    public PadAddElement () : base () {
      Pad pad = new Pad ("source", PadDirection.Src);
      CollectionAssert.IsEmpty (Pads);

      AddPad (pad);
      Assert.AreEqual (pad, GetStaticPad ("source"));
      CollectionAssert.Contains (Pads, pad);

      RemovePad (pad);
      Assert.IsNull (GetStaticPad ("source"));
      CollectionAssert.IsEmpty (Pads);
    }
开发者ID:jwzl,项目名称:ossbuild,代码行数:12,代码来源:ElementTest.cs


示例12: TestPlainCreation

  public void TestPlainCreation() {
    Pad src = new Pad ("src", PadDirection.Src);
    Pad sink = new Pad ("sink", PadDirection.Sink);

    Assert.IsNotNull (src);
    Assert.IsNotNull (sink);

    Assert.IsFalse (src.Handle == IntPtr.Zero, "Ooops, src pad has null handle");
    Assert.IsFalse (sink.Handle == IntPtr.Zero, "Ooops, sink pad has null handle");

    Assert.AreEqual (PadDirection.Src, src.Direction);
    Assert.AreEqual (PadDirection.Sink, sink.Direction);
  }
开发者ID:jwzl,项目名称:ossbuild,代码行数:13,代码来源:PadTest.cs


示例13: GetPadRangeY

 public override PadRange GetPadRangeY(object obj, Pad pad)
 {
     var ts = obj as TimeSeries;
     if (ts == null || ts.Count == 0)
         return null;
     var dt1 = new DateTime((long)pad.XMin);
     var dt2 = new DateTime((long)pad.XMax);
     var min = ts.GetMin(dt1, dt2);
     min = double.IsNaN(min) ? 0 : min;
     var max = ts.GetMax(dt1, dt2);
     max = double.IsNaN(max) ? 0 : min;
     return new PadRange(min, max);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:13,代码来源:TimeSeriesViewer.cs


示例14: TTitle

 public TTitle(Pad pad, string text = "")
 {
     this.pad = pad;
     Text = Text;
     Items = new ArrayList();
     ItemsEnabled = false;
     Font = new Font("Arial", 8f);
     Color = Color.Black;
     Position = ETitlePosition.Left;
     Strategy = ETitleStrategy.Smart;
     X = 0;
     Y = 0;
 }
开发者ID:28427328,项目名称:SQCharts,代码行数:13,代码来源:TTitle.cs


示例15: GetPadRangeY

 public override PadRange GetPadRangeY(object obj, Pad pad)
 {
     var ts = obj as TickSeries;
     if (ts == null || ts.Count == 0)
         return null;
     var dt1 = new DateTime((long) pad.XMin);
     var dt2 = new DateTime((long) pad.XMax);
     var min = ts.GetMin(dt1, dt2);
     var minPx = min?.Price ?? 0;
     var max = ts.GetMax(dt1, dt2);
     var maxPx = max?.Price ?? 0;
     return new PadRange(minPx, maxPx);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:13,代码来源:TickSeriesViewer.cs


示例16: GetPadRangeY

 public override PadRange GetPadRangeY(object obj, Pad pad)
 {
     var bs = obj as BarSeries;
     if (bs == null || bs.Count == 0)
         return null;
     var dt1 = new DateTime((long)pad.XMin);
     var dt2 = new DateTime((long)pad.XMax);
     var lowest = bs.LowestLowBar(dt1, dt2);
     var min = lowest?.Low ?? 0;
     var highest = bs.HighestHighBar(dt1, dt2);
     var max = highest?.High ?? 0;
     return new PadRange(min, max);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:13,代码来源:BarSeriesViewer.cs


示例17: Axis

 private Axis(Pad pad, double x1, double y1, double x2, double y2, EAxisPosition position)
 {
     this.pad = pad;
     Position = position;
     X1 = x1;
     X2 = x2;
     Y1 = y1;
     Y2 = y2;
     Enabled = true;
     Zoomed = false;
     Color = Color.Black;
     Title = "";
     TitleEnabled = true;
     TitlePosition = EAxisTitlePosition.Centre;
     TitleFont = new Font("Arial", 8f);
     TitleColor = Color.Black;
     TitleOffset = 2;
     LabelEnabled = true;
     LabelFont = new Font("Arial", 8f);
     LabelColor = Color.Black;
     LabelFormat = (string)null;
     LabelOffset = 2;
     LabelAlignment = EAxisLabelAlignment.Centre;
     GridEnabled = true;
     GridColor = Color.Gray;
     GridDashStyle = DashStyle.Solid;
     GridWidth = 0.5f;
     MinorGridEnabled = false;
     MinorGridColor = Color.Gray;
     MinorGridDashStyle = DashStyle.Solid;
     MinorGridWidth = 0.5f;
     MajorTicksEnabled = true;
     MajorTicksColor = Color.Black;
     MajorTicksWidth = 0.5f;
     MajorTicksLength = 4;
     MinorTicksEnabled = true;
     MinorTicksColor = Color.Black;
     MinorTicksWidth = 0.5f;
     MinorTicksLength = 1;
     Type = EAxisType.Numeric;
     VerticalGridStyle = EVerticalGridStyle.ByDateTime;
     this.fMouseDown = false;
     this.fMouseDownX = 0;
     this.fMouseDownY = 0;
     this.fOutlineEnabled = false;
     this.fOutline1 = 0;
     this.fOutline2 = 0;
     this.fWidth = -1;
     this.fHeight = -1;
 }
开发者ID:28427328,项目名称:SQCharts,代码行数:50,代码来源:Axis.cs


示例18: CalculateAxes

 public void CalculateAxes(Pad pad, int left, int top, int h)
 {
     this.Left = left;
     this.Top = top;
     this.H = h;
     this.O = new TVec3((double)(left + h / 2), (double)(top + 3 * h / 4), 0.0);
     if (this.ScaleZ < 1.0)
         this.O.y -= (1.0 - this.ScaleZ) * 0.25 * (double)h;
     double num = 0.7 * (double)h;
     double Z = 0.5 * this.ScaleZ * (double)h;
     this.Lx = new TVec3(num, 0.0, 0.0);
     this.Ly = new TVec3(0.0, num, 0.0);
     this.Lz = new TVec3(0.0, 0.0, Z);
     this.Lx = this.ms * this.Lx;
     this.Ly = this.ms * this.Ly;
     this.Lz = this.ms * this.Lz;
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:17,代码来源:TView.cs


示例19: Game

        static Game()
        {
            //CustomGXTs = new Dictionary<string, string>();
            CustomGXTs = new TextDictionary();

            TextHook.RegisterCallback(key =>
            {
                if (CustomGXTs.ContainsKey(key))
                {
                    return CustomGXTs[key];
                }

                return null;
            });

            #if GTA_SA
            GamePad = new Pad(new IntPtr(0xB73458));
            GamePad2 = new Pad(new IntPtr(0xB7358C));
            #endif

            InstallFolder = System.Windows.Forms.Application.StartupPath;
        }
开发者ID:Debug-,项目名称:gtadotnet,代码行数:22,代码来源:Game.cs


示例20: Paint

 public unsafe void Paint(Pad Pad)
 {
     TView tview = TView.View(Pad);
     this.Left = tview.Left;
     this.Top = tview.Top;
     this.W = tview.H;
     this.H = tview.H;
     this.o = tview.O - new TVec3((double) this.Left, (double) this.Top, 0.0);
     this.Lx = tview.Lx;
     this.Ly = tview.Ly;
     this.Lz = tview.Lz;
     this.Light = tview.Light;
     if (this.Look == EChartLook.SurfaceOnly)
         this.BitmapWriteOnly = false;
     Bitmap bm = new Bitmap(this.W, this.H, PixelFormat.Format32bppRgb);
     this.BackgroundIntoBitmapIfNeeded(Pad, bm);
     Rectangle rect = new Rectangle(0, 0, this.W, this.H);
     BitmapData bitmapdata = bm.LockBits(rect, this.BitmapWriteOnly ? ImageLockMode.WriteOnly : ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);
     this.PaintBuffer((int*) bitmapdata.Scan0.ToPointer());
     bm.UnlockBits(bitmapdata);
     Color transparentColor = Color.FromArgb((int) byte.MaxValue, 0, 0, 0);
     bm.MakeTransparent(transparentColor);
     Pad.Graphics.DrawImage((Image) bm, this.Left, this.Top);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:24,代码来源:TFunction.cs



注:本文中的Pad类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Padding类代码示例发布时间:2022-05-24
下一篇:
C# PackingSize类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap