当前位置: 首页>>代码示例>>C#>>正文


C# Drawing.RectangleF类代码示例

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


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

示例1: Generate

        public override void Generate(ref Device device)
        {
            bounds = new System.Drawing.RectangleF(-30.0f, 0.0f, 60.0f, 30.0f);
              texture = Microsoft.DirectX.Direct3D.TextureLoader.FromFile(
                device,
                Environment.CurrentDirectory + "\\Texture\\SKY_BOX_EGYPT.BMP",
                0,
                0,
                1,
                Usage.None,
                Format.Unknown,
                Pool.Managed,
                Filter.None,
                Filter.None,
                System.Drawing.Color.Magenta.ToArgb());

              float yOffSet = bounds.Height / 2;
              vertices = new CustomVertex.PositionColoredTextured[4];
              vertices[0].Position = new Vector3(bounds.X, bounds.Y + yOffSet, -15.0f);
              vertices[0].Tu = 0.0f; vertices[0].Tv = 0.0f;
              vertices[0].Color = System.Drawing.Color.LightBlue.ToArgb();

              vertices[1].Position = new Vector3(bounds.X, bounds.Y - yOffSet, -15.0f);
              vertices[1].Color = System.Drawing.Color.White.ToArgb();
              vertices[1].Tu = 0.0f; vertices[1].Tv = 1.0f;

              vertices[2].Position = new Vector3(bounds.X + bounds.Width, bounds.Y + yOffSet, -15.0f);
              vertices[2].Color = System.Drawing.Color.LightBlue.ToArgb();
              vertices[2].Tu = 1.0f; vertices[2].Tv = 0.0f;

              vertices[3].Position = new Vector3(bounds.X + bounds.Width, bounds.Y - yOffSet, -15.0f);
              vertices[3].Color = System.Drawing.Color.White.ToArgb();
              vertices[3].Tu = 1.0f; vertices[3].Tv = 1.0f;
        }
开发者ID:stevenandrewcarter,项目名称:Bombard,代码行数:34,代码来源:SkyBox.cs

示例2: MiniCell

 public MiniCell()
     : base(UITableViewCellStyle.Value1,Key)
 {
     Frame = new System.Drawing.RectangleF (0, 0, 320, 30);
     TextLabel.Font = UIFont.SystemFontOfSize (UIFont.SmallSystemFontSize + 2);
     DetailTextLabel.Font = UIFont.SystemFontOfSize (UIFont.SmallSystemFontSize + 2);
 }
开发者ID:nagyist,项目名称:iPadPos,代码行数:7,代码来源:MiniCell.cs

示例3: RunCommand

        protected override Rhino.Commands.Result RunCommand(Rhino.RhinoDoc doc, Rhino.Commands.RunMode mode)
        {
            MonoMac.ObjCRuntime.Runtime.RegisterAssembly (this.GetType ().Assembly);
              var vm = new DNViewModel();
              var win = RhinoMac.Window.FromNib("CocoaRhinoWindow", vm);

              win.Title = "On the fly";

              var rect = new System.Drawing.RectangleF(10, 100, 200, 50);
              //var btn = new MonoMac.AppKit.NSButton (rect);
              var btn = new CustomButton(rect);

              win.ContentView.AddSubview(btn);
              btn.Title = "On the fly";
              btn.SetButtonType(MonoMac.AppKit.NSButtonType.MomentaryLightButton);
              btn.BezelStyle = MonoMac.AppKit.NSBezelStyle.Rounded;
              TestResponer res = new TestResponer ();
              btn.Activated += (object sender, EventArgs e) => {
            MonoMac.AppKit.NSFontManager.SharedFontManager.Target = res;
            MonoMac.AppKit.NSFontManager.SharedFontManager.OrderFrontFontPanel (btn);
              };
              res.NextResponder = win.NextResponder;
              win.NextResponder = res;

              win.ShowModal();

              return Rhino.Commands.Result.Success;
        }
开发者ID:sbaer,项目名称:cocoarhino_cs,代码行数:28,代码来源:CocoaRhinoCommand.cs

示例4: Draw

        public override void Draw(System.Drawing.RectangleF rect)
        {
            base.Draw(rect);

            var width = rect.Width / 2f - 1f;
            var addedRect = new System.Drawing.RectangleF(0, 0, width, rect.Height);
            var removedRect = new System.Drawing.RectangleF(rect.Width / 2f + 1f, 0, width, rect.Height);

            var context = UIGraphics.GetCurrentContext();
            context.SaveState();
            context.SetFillColor(UIColor.FromRGB(204, 255, 204).CGColor);
            context.AddPath(GraphicsUtil.MakeRoundedRectPath(addedRect, 5));
            context.FillPath();

            context.SetFillColor(UIColor.FromRGB(255, 221, 221).CGColor);
            context.AddPath(GraphicsUtil.MakeRoundedRectPath(removedRect, 5));
            context.FillPath();

            context.RestoreState();

            UIColor.FromRGB(57, 152, 57).SetColor();
            var stringRect = addedRect;
            stringRect.Y += 1f;
            string addedString = (Added == null) ? "-" : "+" + Added.Value;
            DrawString(addedString, stringRect, UIFont.SystemFontOfSize(12f), UILineBreakMode.TailTruncation, UITextAlignment.Center);

            UIColor.FromRGB(0xcc, 0x33, 0x33).SetColor();
            stringRect = removedRect;
            stringRect.Y += 1f;
            string removedString = (Removed == null) ? "-" : "-" + Removed.Value;
            DrawString(removedString, stringRect, UIFont.SystemFontOfSize(12f), UILineBreakMode.TailTruncation, UITextAlignment.Center);
        }
开发者ID:rcaratchuk,项目名称:CodeFramework,代码行数:32,代码来源:AddRemoveView.cs

示例5: ViewDidMoveToSuperview

 public override void ViewDidMoveToSuperview ()
 {
     Frame = new System.Drawing.RectangleF(0, 25, Superview.Bounds.Width, Superview.Bounds.Height - 60);
     AdjustSubviews();
     SetPositionOfDivider(Bounds.Width/3, 0);
     base.ViewDidMoveToSuperview ();
 }
开发者ID:joelmuzz,项目名称:DotSpatial,代码行数:7,代码来源:SpatialDockManager.cs

示例6: UIMapControlInputHandler

        protected UIMapControlInputHandler(InputMode setInputMode, UIMapControl setUIMapControl)
        {
            mapUnitOrder = MapUnitOrder.None;
             IsSpanningRectangle = false;
             selectionRectangle = RectangleF.Empty;

             MapControl = setUIMapControl;
             InputMode = setInputMode;
        }
开发者ID:CAMongrel,项目名称:WinWar,代码行数:9,代码来源:UIMapControlInputHandler.cs

示例7: Rect

 public static System.Drawing.RectangleF Rect(System.Drawing.Rectangle rect)
 {
     var new_rect = new System.Drawing.RectangleF();
     new_rect.X = rect.X;
     new_rect.Y = rect.Y;
     new_rect.Width = rect.Width;
     new_rect.Height = rect.Height;
     return new_rect;
 }
开发者ID:modulexcite,项目名称:Visio-Power-Tools,代码行数:9,代码来源:ColorPickerUtil.cs

示例8: Draw

 public override void Draw(System.Drawing.Graphics g)
 {
     System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
     System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - RadiusX), (float)(Center.Y - RadiusY));
     System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)(2 * RadiusX), (float)(2 * RadiusY));
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
     g.FillEllipse(solidBrush, rect);
     solidBrush.Dispose();
 }
开发者ID:abdonkov,项目名称:HackBulgaria-CSharp,代码行数:9,代码来源:Ellipse.cs

示例9: Draw

 public override void Draw(System.Drawing.Graphics g)
 {
     System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
     System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - Width / 2), (float)(Center.Y - Height / 2));
     System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)Width, (float)Height);
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
     g.FillRectangle(solidBrush, rect);
     solidBrush.Dispose();
 }
开发者ID:abdonkov,项目名称:HackBulgaria-CSharp,代码行数:9,代码来源:Rectangle.cs

示例10: IsCross

        /// <summary>
        /// 获取编辑器对象的宽度
        /// </summary>
        /// <returns></returns>
        //public float GetWidth()
        //{
        //    return Math.Abs(this.Left - this.Right);
        //}

        ///// <summary>
        ///// 获取编辑器对象的高度
        ///// </summary>
        ///// <returns></returns>
        //public float GetHeight()
        //{
        //    return Math.Abs(this.Top - this.Bottom);
        //}

        /// <summary>
        /// 矩形区域与形参中的区域是否重叠交叉
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="right"></param>
        /// <param name="bottom"></param>
        /// <returns></returns>
        public bool IsCross(float x,float y,float right,float bottom)
        {
            bool isCoross = false;

            System.Drawing.RectangleF srcRect = new System.Drawing.RectangleF(this.Left, this.Top, this.Width, this.Height);
            System.Drawing.RectangleF destRect = new System.Drawing.RectangleF(x, y, right, bottom);
            if (srcRect.IntersectsWith(destRect)) isCoross = true;

            return isCoross;
        }
开发者ID:yuzhantao,项目名称:ColorEditor,代码行数:36,代码来源:EditorObjectRectangle.cs

示例11: TestCreateSVGObject

 public void TestCreateSVGObject()
 {
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(); ;
     string lineBrush = null;
     string fillBrush = null;
     string expectedString = null;
     string resultString = null;
     resultString = _unitUnderTest.CreateSVGObject(rect, lineBrush, fillBrush);
     Assert.AreEqual(expectedString, resultString, "CreateSVGObject method returned unexpected result.");
     Assert.Fail("Create or modify test(s).");
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:11,代码来源:TestFigureBase.cs

示例12: DarkSwitch

		public DarkSwitch(bool on)
		{
			InsertSegment("ON", 0, false);
			InsertSegment("OFF", 1, false);
			Frame = new System.Drawing.RectangleF(0, 0, 100, 30);
			
			ControlStyle = UISegmentedControlStyle.Bar;
			BackgroundColor = StyleExtensions.transparent;
			TintColor = UIColor.FromRGB(100, 100, 100);
			
			SelectedSegment = (on) ? 0 : 1;
		}
开发者ID:Smeedee,项目名称:Smeedee-Mobile,代码行数:12,代码来源:WidgetConfigTableViewSource.cs

示例13: Init

        public static void Init(TestContext context)
        {
            dp1 = new System.Drawing.Point(10, 10);
            dp2 = new System.Drawing.Point(100, 100);
            drect = new System.Drawing.Rectangle(5, 5, 15, 15);

            wp1 = new System.Windows.Point(10, 10);
            wp2 = new System.Windows.Point(100, 100);
            wrect = new System.Windows.Rect(5, 5, 15, 15);

            fp1 = new System.Drawing.PointF(10, 10);
            fp2 = new System.Drawing.PointF(100, 100);
            frect = new System.Drawing.RectangleF(5, 5, 15, 15);
        }
开发者ID:CHiiLD,项目名称:net-toolkit,代码行数:14,代码来源:PointTest.cs

示例14: UpdateBoundsAndMargins

    /// <summary>
    /// Update the default bounds and margins after the printer settings changed.
    /// This function must be called manually after a page setup dialog.
    /// </summary>
    public void UpdateBoundsAndMargins()
    {
      if (_printerSettings.IsValid)
      {
        _printerPageBounds = _printDocument.DefaultPageSettings.Bounds;
        _printerMargins = _printDocument.DefaultPageSettings.Margins;
      }
      else // obviously no printer installed, use A4 size (sorry, this is european size)
      {
        _printerPageBounds = new System.Drawing.RectangleF(0, 0, 1169, 826);
        _printerMargins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
      }

    }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:18,代码来源:PrintingService.cs

示例15: Draw

        public override void Draw(CGRect rect)
        {
            base.Draw(rect);

            var step = 1f / 6f;
            var locations = new nfloat[]
            {
                0.0f,
                step * 1f,
                step * 2f,
                step * 3f,
                step * 4f,
                step * 5f,
                1.0f
            };
            var colors = new CGColor[]
            {
                UIColor.Red.CGColor,
                new CGColor(1, 0, 1, 1),
                UIColor.Blue.CGColor,
                new CGColor(0, 1, 1, 1),
                UIColor.Green.CGColor,
                new CGColor(1, 1, 0, 1),
                UIColor.Red.CGColor
            };

            using (var colorSpace = CGColorSpace.CreateDeviceRGB())
            using (var gradiend = new CGGradient(colorSpace, colors, locations))
            {
                var context = UIGraphics.GetCurrentContext();
                context.DrawLinearGradient(gradiend, new CGPoint(rect.Size.Width, 0), new CGPoint(0, 0), CGGradientDrawingOptions.DrawsBeforeStartLocation);
            }
        }
开发者ID:mattleibow,项目名称:AdvancedColorPicker,代码行数:33,代码来源:HuePickerView.cs


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