本文整理汇总了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);
}
示例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);
}
示例3: OnDraw
public override void OnDraw(Graphics2D graphics2D)
{
graphics2D.Clear(RGBA_Bytes.White);
base.OnDraw(graphics2D);
}
示例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();
}
示例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);
}
示例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();
}