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


C# Graphics2D.FillRectangle方法代码示例

本文整理汇总了C#中MatterHackers.Agg.Graphics2D.FillRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# Graphics2D.FillRectangle方法的具体用法?C# Graphics2D.FillRectangle怎么用?C# Graphics2D.FillRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MatterHackers.Agg.Graphics2D的用法示例。


在下文中一共展示了Graphics2D.FillRectangle方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDraw

		public override void OnDraw(Graphics2D graphics2D)
		{
			int thumbHeight = 10;
			//graphics2D.Rectangle(LocalBounds, RGBA_Bytes.Black);
			double bottom = textScrollWidget.Position0To1 * (Height - thumbHeight);// the 2 is the border
			RectangleDouble thumb = new RectangleDouble(0, bottom, Width, bottom + thumbHeight);// the 1 is the border
			graphics2D.FillRectangle(thumb, RGBA_Bytes.DarkGray);
			base.OnDraw(graphics2D);
		}
开发者ID:fuding,项目名称:MatterControl,代码行数:9,代码来源:TextScrolBar.cs

示例2: PrintTopOfPage

        private double PrintTopOfPage(ImageBuffer plateInventoryImage, Graphics2D plateGraphics)
        {
            plateGraphics.Clear(RGBA_Bytes.White);

            double currentlyPrintingHeightPixels = plateInventoryImage.Height - PageMarginMM.Top * PixelPerMM;

            string logoPathAndFile = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "PartSheetLogo.png");
            if(File.Exists(logoPathAndFile))
            {
                ImageBuffer logoImage = new ImageBuffer();
                ImageIO.LoadImageData(logoPathAndFile, logoImage);
                currentlyPrintingHeightPixels -= logoImage.Height;
                plateGraphics.Render(logoImage, (plateInventoryImage.Width - logoImage.Width) / 2, currentlyPrintingHeightPixels);
            }

            currentlyPrintingHeightPixels -= PartPaddingPixels;

            double underlineHeightMM = 1;
            RectangleDouble lineBounds = new RectangleDouble(0, 0, plateInventoryImage.Width - PageMarginPixels.Left * 2, underlineHeightMM * PixelPerMM);
            lineBounds.Offset(PageMarginPixels.Left, currentlyPrintingHeightPixels - lineBounds.Height);
            plateGraphics.FillRectangle(lineBounds, RGBA_Bytes.Black);

            return currentlyPrintingHeightPixels - (lineBounds.Height + PartPaddingPixels);
        }
开发者ID:klewisjohnson,项目名称:MatterControl,代码行数:24,代码来源:PartsSheetCreator.cs

示例3: OnDraw

		public override void OnDraw(Graphics2D graphics2D)
		{
			graphics2D.Circle(Width / 2, Height / 2, Width / 2, RGBA_Bytes.White);
			graphics2D.Circle(Width / 2, Height / 2, Width / 2 - 1, RGBA_Bytes.Red);
			graphics2D.FillRectangle(Width / 2 - 1, Height / 2 - 3, Width / 2 + 1, Height / 2 + 3, RGBA_Bytes.White);
			base.OnDraw(graphics2D);
		}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:7,代码来源:WidescreenPanel.cs

示例4: OnDraw

 public override void OnDraw(Graphics2D graphics2D)
 {
     RectangleDouble barBounds = bar.BoundsRelativeToParent;
     graphics2D.FillRectangle(barBounds.Left, barBounds.Bottom, barBounds.Left + barBounds.Width * PercentComplete / 100.0, barBounds.Top, ActiveTheme.Instance.PrimaryAccentColor);
     graphics2D.Rectangle(barBounds, RGBA_Bytes.Black);
     base.OnDraw(graphics2D);
 }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:7,代码来源:ProgressControl.cs

示例5: OnDraw

		public override void OnDraw(Graphics2D graphics2D)
		{
			graphics2D.FillRectangle(0, 0, Width * currentPercent / 100, Height, completeColor);

			base.OnDraw(graphics2D);
		}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:6,代码来源:PrintProgressBarWidget.cs

示例6: OnDraw

        public override void OnDraw(Graphics2D graphics2D)
        {
#if false
            if (firstDraw)
            {
                firstDraw = false;
                SystemWindow testAbout = new SystemWindow(600, 300);

                string path = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "OEMSettings", "AboutPage.html");
                string htmlText = File.ReadAllText(path);
                HTMLCanvas canvas = new HTMLCanvas(htmlText);
                canvas.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

                canvas.AddReplacementString("textColor", RGBA_Bytes.White.GetAsHTMLString());

                canvas.AnchorAll();
                testAbout.AddChild(canvas);

                testAbout.ShowAsSystemWindow();
            }
#endif

            graphics2D.FillRectangle(new RectangleDouble(0, this.Height - 1, this.Width, this.Height), RGBA_Bytes.White);
            base.OnDraw(graphics2D);
        }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:25,代码来源:AboutPage.cs

示例7: OnDraw

        public override void OnDraw(Graphics2D graphics2D)
        {
            if(needRedraw)
            {
                needRedraw = false;
                rayTraceScene();
            }
            trackBallTransform.AxisToWorld = trackBallController.GetTransform4X4();

            graphics2D.FillRectangle(new rect_d(0, 0, 1000, 1000), RGBA_Bytes.Red);
            graphics2D.Render(destImage, 0, 0);
            trackBallController.DrawRadius(graphics2D);

            graphics2D.DrawString("Ray Trace: " + renderTime.ElapsedMilliseconds.ToString(), 20, 10);

            base.OnDraw(graphics2D);
        }
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:17,代码来源:PreviewWindowRayTrace.cs

示例8: PrintTopOfPage

		private double PrintTopOfPage(ImageBuffer plateInventoryImage, Graphics2D plateGraphics)
		{
			plateGraphics.Clear(RGBA_Bytes.White);

			double currentlyPrintingHeightPixels = plateInventoryImage.Height - PageMarginMM.Top * PixelPerMM;

			// TODO: Application should not save data back to StaticDataPath - use application data dir instead
			string logoPathAndFile = "PartSheetLogo.png";
			if (StaticData.Instance.FileExists(logoPathAndFile))
			{
				ImageBuffer logoImage = StaticData.Instance.LoadImage(logoPathAndFile);
				currentlyPrintingHeightPixels -= logoImage.Height;
				plateGraphics.Render(logoImage, (plateInventoryImage.Width - logoImage.Width) / 2, currentlyPrintingHeightPixels);
			}

			currentlyPrintingHeightPixels -= PartPaddingPixels;

			double underlineHeightMM = 1;
			RectangleDouble lineBounds = new RectangleDouble(0, 0, plateInventoryImage.Width - PageMarginPixels.Left * 2, underlineHeightMM * PixelPerMM);
			lineBounds.Offset(PageMarginPixels.Left, currentlyPrintingHeightPixels - lineBounds.Height);
			plateGraphics.FillRectangle(lineBounds, RGBA_Bytes.Black);

			return currentlyPrintingHeightPixels - (lineBounds.Height + PartPaddingPixels);
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:24,代码来源:PartsSheetCreator.cs

示例9: DoDrawBeforeChildren

 public void DoDrawBeforeChildren(Graphics2D graphics2D)
 {
     // erase to the background color
     graphics2D.FillRectangle(GetTotalBounds(), BackgroundColor);
 }
开发者ID:jeske,项目名称:agg-sharp,代码行数:5,代码来源:Slider.cs

示例10: OnDraw

 public override void OnDraw(Graphics2D graphics2D)
 {
     graphics2D.Circle(Width / 2, Height / 2, Width / 2, RGBA_Bytes.White);
     graphics2D.Circle(Width / 2, Height / 2, Width / 2 - 1, RGBA_Bytes.Red);
     graphics2D.FillRectangle(Width / 2 - 1, Height / 2 - 3, Width / 2 + 1, Height / 2 + 3, RGBA_Bytes.White);
     //graphics2D.DrawString("1", Width / 2, Height / 2 + 1, 8, Justification.Center, Baseline.BoundsCenter, RGBA_Bytes.White);
     base.OnDraw(graphics2D);
 }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:8,代码来源:WidescreenPanel.cs

示例11: OnDraw

        public override void OnDraw(Graphics2D graphics2D)
        {
            MatterCadWidget_OnDraw.Start();
            graphics2D.Clear(RGBA_Bytes.White);
            rect_d rect = new rect_d(Width - 40, 10, Width - 10, 40);
            graphics2D.FillRectangle(rect, previewWindowRayTrace.mouseOverColor);
            graphics2D.Rectangle(rect, RGBA_Bytes.Black);
            Invalidate(rect);

            base.OnDraw(graphics2D);
            MatterCadWidget_OnDraw.Stop();
        }
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:12,代码来源:MatterCadWidget.cs

示例12: OnDraw

		public override void OnDraw(Graphics2D graphics2D)
		{
			Matrix4X4 currentRenderMatrix = trackballTumbleWidget.ModelviewMatrix;
			if (lastRenderedMatrix != currentRenderMatrix)
			{
				Stopwatch traceTime = new Stopwatch();
				traceTime.Start();
				rayTraceScene();
				traceTime.Stop();

				timingStrings.Add("Time to trace BVH {0:0.0}s".FormatWith(traceTime.Elapsed.TotalSeconds));
			}
			//allObjectsHolder.AxisToWorld = trackBallController.GetTransform4X4();

			graphics2D.FillRectangle(new RectangleDouble(0, 0, 1000, 1000), RGBA_Bytes.Red);
			graphics2D.Render(destImage, 0, 0);
			//trackBallController.DrawRadius(graphics2D);
			totalTime.Stop();
			timingStrings.Add("Total Time {0:0.0}s".FormatWith(totalTime.Elapsed.TotalSeconds));

			if (!SavedTimes)
			{
				SavedTimes = true;
				File.WriteAllLines("timing.txt", timingStrings.ToArray());
			}

			graphics2D.DrawString("Ray Trace: " + renderTime.ElapsedMilliseconds.ToString(), 20, 10);

			base.OnDraw(graphics2D);
			currentRenderMatrix = lastRenderedMatrix;
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:31,代码来源:RayTracerWiget.cs


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