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


C# Graphics2D.Clear方法代码示例

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


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

示例1: OnDraw

		public override void OnDraw(Graphics2D graphics2D)
		{
			ImageBuffer widgetsSubImage = ImageBuffer.NewSubImageReference(graphics2D.DestImage, graphics2D.GetClippingRect());

			IImageByte backBuffer = widgetsSubImage;

			if (firstTime)
			{
				firstTime = false;
				m_SuperFast = new MatterHackers.Agg.UI.CheckBox(10, 10, "Run Super Fast");
				AddChild(m_SuperFast);
				m_Controller = new CController(backBuffer, 30, 40, .1, .7, .3, 4, 1, 2000);
			}

			graphics2D.Clear(new RGBA_Floats(1, 1, 1, 1));
			graphics2D.Rasterizer.SetVectorClipBox(0, 0, (int)Width, (int)Height);
			m_Controller.FastRender(m_SuperFast.Checked);
			m_Controller.Render(graphics2D);
			//m_SuperFast.Render(graphics2D);
			base.OnDraw(graphics2D);
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:21,代码来源:SmartSweepers.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.Clear(RGBA_Bytes.White);

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

示例4: OnDraw

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

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

示例5: 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

示例6: 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


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