private static void CreateButtonImages(out ImageBuffer togetherBig, out ImageBuffer appartBig) { PathStorage upArrow = new PathStorage(); upArrow.MoveTo(0, 0); upArrow.LineTo(.5, -.5); upArrow.LineTo(.25, -.5); upArrow.LineTo(.25, -1); upArrow.LineTo(-.25, -1); upArrow.LineTo(-.25, -.5); upArrow.LineTo(-.5, -.5); int buttonSize = 32; int arrowSize = buttonSize / 3; togetherBig = new ImageBuffer(buttonSize, buttonSize, 32, new BlenderBGRA()); Graphics2D togetherBigGraphics = togetherBig.NewGraphics2D(); togetherBigGraphics.Clear(RGBA_Bytes.White); int margin = buttonSize / 16; int lineWidth = buttonSize / 16; togetherBigGraphics.FillRectangle(margin, buttonSize / 2 + margin, buttonSize - margin, buttonSize / 2 + margin + lineWidth, RGBA_Bytes.Black); togetherBigGraphics.FillRectangle(margin, buttonSize / 2 - margin, buttonSize - margin, buttonSize / 2 - margin - lineWidth, RGBA_Bytes.Black); appartBig = new ImageBuffer(togetherBig); // point up Affine totalTransform = Affine.NewScaling(arrowSize, arrowSize); totalTransform *= Affine.NewTranslation(buttonSize / 2, buttonSize / 2 - margin - lineWidth); togetherBigGraphics.Render(new VertexSourceApplyTransform(upArrow, totalTransform), RGBA_Bytes.Black); // point down totalTransform = Affine.NewRotation(MathHelper.Tau / 2); totalTransform *= Affine.NewScaling(arrowSize, arrowSize); totalTransform *= Affine.NewTranslation(buttonSize / 2, buttonSize / 2 + margin + lineWidth); togetherBigGraphics.Render(new VertexSourceApplyTransform(upArrow, totalTransform), RGBA_Bytes.Black); Graphics2D appartBigGraphics = appartBig.NewGraphics2D(); // point up totalTransform = Affine.NewScaling(arrowSize, arrowSize); totalTransform *= Affine.NewTranslation(buttonSize / 2, buttonSize / 2 + margin + lineWidth + arrowSize + 1); appartBigGraphics.Render(new VertexSourceApplyTransform(upArrow, totalTransform), RGBA_Bytes.Black); // point down totalTransform = Affine.NewRotation(MathHelper.Tau / 2); totalTransform *= Affine.NewScaling(arrowSize, arrowSize); totalTransform *= Affine.NewTranslation(buttonSize / 2, buttonSize / 2 - margin - lineWidth - arrowSize - 1); appartBigGraphics.Render(new VertexSourceApplyTransform(upArrow, totalTransform), RGBA_Bytes.Black); }
public void DrawAfterChildren(Graphics2D graphics2D) { if (SwitchState) { RectangleDouble interior = GetSwitchBounds(); interior.Inflate(-6); graphics2D.FillRectangle(interior, InteriorColor); } RectangleDouble border = GetSwitchBounds(); border.Inflate(-3); graphics2D.Rectangle(border, ExteriorColor, 1); graphics2D.FillRectangle(GetThumbBounds(), ThumbColor); graphics2D.Rectangle(GetThumbBounds(), new RGBA_Bytes(255, 255, 255, 90), 1); }
private void ConditionalDrawAndRefresh(SystemWindow systemWindow) { if (this.Invalidated && !iconified) { ResetViewport(); this.Invalidated = false; Graphics2D graphics2D = NewGraphics2D(); for (var i = 0; i < this.WindowProvider.OpenWindows.Count; i++) { var window = this.WindowProvider.OpenWindows[i]; // Due to handling in CloseSystemWindow, testing can sometimes end up handling a draw event with no PlatformWindow, so skip this window. // TODO: Unify this stuff with PlatformWin32? if (window.PlatformWindow == null) { continue; } if (i > 0) { window.Size = systemWindow.Size; ResetViewport(); graphics2D.FillRectangle(this.WindowProvider.OpenWindows[0].LocalBounds, new Agg.Color(Agg.Color.Black, 160)); } window.OnDraw(graphics2D); } Glfw.SwapBuffers(glfwWindow); } }
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; }
public override void OnDraw(Graphics2D graphics2D) { if (NeedRedraw) { NeedRedraw = false; Stopwatch traceTime = new Stopwatch(); traceTime.Start(); rayTraceScene(); traceTime.Stop(); timingStrings.Add("Time to trace BVH {0:0.0}s".FormatWith(traceTime.Elapsed.TotalSeconds)); } trackBallTransform.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); }
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)); }
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); }
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); }
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(); ImageBMPIO.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)); }
private void ConditionalDrawAndRefresh(SystemWindow systemWindow) { if (this.Invalidated && !iconified) { ResetViewport(); this.Invalidated = false; Graphics2D graphics2D = NewGraphics2D(); for (var i = 0; i < this.WindowProvider.OpenWindows.Count; i++) { var window = this.WindowProvider.OpenWindows[i]; if (i > 0) { window.Size = systemWindow.Size; ResetViewport(); graphics2D.FillRectangle(this.WindowProvider.OpenWindows[0].LocalBounds, new Agg.Color(Agg.Color.Black, 160)); } window.OnDraw(graphics2D); } Glfw.SwapBuffers(glfwWindow); } }
public override void OnDraw(Graphics2D graphics2D) { RectangleDouble backgroundRect = new RectangleDouble(LocalBounds.Left - m_border_extra, LocalBounds.Bottom - m_border_extra, LocalBounds.Right + m_border_extra, LocalBounds.Top + m_border_extra); graphics2D.FillRectangle(backgroundRect, m_background_color); PathStorage border = new PathStorage(); border.LineTo(LocalBounds.Left, LocalBounds.Bottom); border.LineTo(LocalBounds.Right, LocalBounds.Bottom); border.LineTo(LocalBounds.Right, LocalBounds.Top); border.LineTo(LocalBounds.Left, LocalBounds.Top); border.LineTo(LocalBounds.Left + m_border_width, LocalBounds.Bottom + m_border_width); border.LineTo(LocalBounds.Left + m_border_width, LocalBounds.Top - m_border_width); border.LineTo(LocalBounds.Right - m_border_width, LocalBounds.Top - m_border_width); border.LineTo(LocalBounds.Right - m_border_width, LocalBounds.Bottom + m_border_width); graphics2D.Render(border, m_border_color); rewind(0); graphics2D.Render(this, m_curve_color); rewind(1); graphics2D.Render(this, m_grid_color); rewind(2); graphics2D.Render(this, m_inactive_pnt_color); rewind(3); graphics2D.Render(this, m_active_pnt_color); rewind(4); graphics2D.Render(this, m_text_color); base.OnDraw(graphics2D); }
private double PrintTopOfPage(ImageBuffer plateInventoryImage, Graphics2D plateGraphics) { plateGraphics.Clear(Color.White); double currentlyPrintingHeightPixels = plateInventoryImage.Height - PageMarginMM.Top * PixelPerMM; string logoPathAndFile = Path.Combine("Images", "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; var lineBounds = new RectangleDouble(0, 0, plateInventoryImage.Width - PageMarginPixels.Left * 2, underlineHeightMM * PixelPerMM); lineBounds.Offset(PageMarginPixels.Left, currentlyPrintingHeightPixels - lineBounds.Height); plateGraphics.FillRectangle(lineBounds, Color.Black); return(currentlyPrintingHeightPixels - (lineBounds.Height + PartPaddingPixels)); }
public override void Draw(Graphics2D g) { Point2I pos = new Point2I(8, 24); if (GameControl.Player.Y < ((GameSettings.VIEW_HEIGHT) / 2 + 8)) { pos.Y = 96; } // TODO: Apply Player position based on view g.FillRectangle(new Rectangle2I(pos, new Point2I(144, 8 + 16 * linesPerWindow)), Color.Black); // Draw the finished writting lines. for (int i = 0; i < windowLine; i++) { if (state == TextReaderState.PushingLine && timer >= 2) { g.DrawLetterString(GameData.FONT_LARGE, wrappedString.Lines[currentLine - windowLine + i], pos + new Point2I(8, 6 + 16 * i + 8), TextColor); } else { g.DrawLetterString(GameData.FONT_LARGE, wrappedString.Lines[currentLine - windowLine + i], pos + new Point2I(8, 6 + 16 * i), TextColor); } } // Draw the currently writting line. g.DrawLetterString(GameData.FONT_LARGE, wrappedString.Lines[currentLine].Substring(0, currentChar), pos + new Point2I(8, 6 + 16 * windowLine), TextColor); // Draw the next line arrow. if ((state == TextReaderState.PressToContinue || state == TextReaderState.PressToEndParagraph) && arrowTimer >= 16) { g.DrawSprite(GameData.SPR_HUD_TEXT_NEXT_ARROW, pos + new Point2I(136, 16 * linesPerWindow)); } }
public override void Draw() { // draw bg if (backColor != SVGA.color) { Graphics2D.FillRectangle(bounds, backColor); } // draw border int bs = this.style.SIZE_BORDER; uint bord = this.style.C_BORDER; if (bs > 0) { Graphics2D.DrawRectangle(bounds, bs, bord); } // draw text int shadSize = this.style.SIZE_TEXT_SHADOW; uint shadCol = this.style.C_TEXT_SHADOW; if (text.Length > 0) { if (shadSize > 0 && shadCol != SVGA.color) { Graphics2D.DrawStringShadow(x, y, text, textColor, shadCol, shadSize, Fonts.FONT_MONO); } else { Graphics2D.DrawString(x, y, text, textColor, Fonts.FONT_MONO); } } }
public override void Draw() { // get style colors uint bg = style.C_BG; uint fg = style.C_TEXT; uint bord = style.C_BORDER; uint bordOuter = style.C_BORDER_OUTER; uint bordInner = style.C_BORDER_INNER; uint fgShadow = style.C_TEXT_SHADOW; uint fgHover = style.C_TEXT_HOVER; uint fgDown = style.C_TEXT_DOWN; uint dis = style.C_DISABLED; uint shadow = style.C_SHADOW; uint hov = style.C_HOVER; uint dwn = style.C_DOWN; // get style sizes int bordSize = style.SIZE_BORDER; int shadowSize = style.SIZE_SHADOW; int fgShadowSize = style.SIZE_TEXT_SHADOW; int borderStyle = style.BORDER_STYLE; // draw background Graphics2D.FillRectangle(bounds, bg); // draw border Graphics2D.DrawRectangle(bounds, 1, bord); // draw buttons for (int i = 0; i < items.Count; i++) { items[i].Draw(); } }
public override void Draw(Graphics2D g) { g.ResetTranslation(); // Draw the room. if (isBeginningFade) { OldRoomControl.Draw(g); } else { NewRoomControl.Draw(g); } // Draw the fade. int t = timer; int delay = TRANSITION_SWITCH_FADE_DELAY / 2; if (!isBeginningFade) { t = (TRANSITION_FADE_DURATION - delay) - t; } float opacity = t / (float)(TRANSITION_FADE_DURATION - delay); opacity = GMath.Clamp(opacity, 0.0f, 1.0f); g.FillRectangle(GameSettings.SCREEN_BOUNDS, fadeColor * opacity); }
public override void Draw(Graphics2D g) { if (BackgroundColor.Alpha0To255 > 0) { g.FillRectangle(new RectD(0, 0, this.Width, Height), BackgroundColor); } render_gpc(g); }
public override void OnDraw(Graphics2D graphics2D) { base.OnDraw(graphics2D); if (content.OriginRelativeParent.y != 0) { graphics2D.FillRectangle(0, 0, Width, KeyboardHeight, RGBA_Bytes.Black); } }
public override void OnDraw(Graphics2D graphics2D) { graphics2D.FillRectangle(GetSwitchBounds(), BackgroundColor); base.OnDraw(graphics2D); if (startValue) { RectangleDouble interior = GetSwitchBounds(); interior.Inflate(-6); graphics2D.FillRectangle(interior, InteriorColor); } RectangleDouble border = GetSwitchBounds(); border.Inflate(-3); graphics2D.Rectangle(border, ExteriorColor, 1); graphics2D.FillRectangle(GetThumbBounds(), ThumbColor); graphics2D.Rectangle(GetThumbBounds(), new RGBA_Bytes(255, 255, 255, 90), 1); }
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); }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 21JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * draw a point. * @param mapPoint a map point object. */ private void DrawPoint(MapPoint mapPoint) { GeoPoint screenPt = FromLatLngToMapPixel(mapPoint.Point); SolidBrush brush = new SolidBrush(new Color(mapPoint.SymbolType.Color, false)); SharedGraphics2D.FillRectangle(brush, new Rectangle((int)screenPt.X - 2, (int)screenPt.Y - 2, 4, 4)); }
private static void DrawTile(Graphics2D g, Tile tile) { if (TileDebugInfoMode == TileDrawInfo.CollisionBoxes) { if (tile.IsSolid && tile.CollisionModel != null) { foreach (Rectangle2F box in tile.CollisionModel.Boxes) { Rectangle2F r = Rectangle2F.Translate(box, tile.Position); g.FillRectangle(r, Color.Red); //g.DrawRectangle(r, 1, Color.Maroon); } } } else if (TileDebugInfoMode == TileDrawInfo.GridArea) { Rectangle2F tileBounds = (Rectangle2F)tile.TileGridArea; tileBounds.Point *= GameSettings.TILE_SIZE; tileBounds.Size *= GameSettings.TILE_SIZE; Color c = Color.Yellow; if (tile.Layer == 1) { c = Color.Blue; } else if (tile.Layer == 2) { c = Color.Red; } g.FillRectangle(tileBounds, c); tileBounds = new Rectangle2F(tile.Position, tile.Size * GameSettings.TILE_SIZE); c = Color.Olive; if (tile.Layer == 1) { c = Color.Cyan; } else if (tile.Layer == 2) { c = Color.Maroon; } g.DrawLine(new Line2F(tileBounds.TopLeft, tileBounds.BottomRight - new Point2I(1, 1)), 1, c); g.DrawLine(new Line2F(tileBounds.TopRight - new Point2I(1, 0), tileBounds.BottomLeft - new Point2I(0, 1)), 1, c); g.DrawRectangle(tileBounds, 1, Color.Black); } }
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); }
public override void Draw(Graphics2D g) { g.ResetTranslation(); if (timer < TRANSITION_SPLIT_BEGIN_DELAY) { OldRoomControl.Draw(g); } else { NewRoomControl.Draw(g); g.ResetTranslation(); g.Translate(0, 16); g.FillRectangle(new Rectangle2F(0, 0, sideWidths[0], GameSettings.VIEW_HEIGHT), splitColor); g.FillRectangle(new Rectangle2F(GameSettings.VIEW_WIDTH - sideWidths[1], 0, sideWidths[1], GameSettings.VIEW_HEIGHT), splitColor); } }
public override void OnDraw(Graphics2D graphics2D) { graphics2D.FillRectangle(switchBounds, this.BackgroundColor); base.OnDraw(graphics2D); if (this.Checked) { graphics2D.FillRectangle(innerRect, this.InteriorColor); } // Draw border graphics2D.Rectangle(borderRect, (this.Enabled) ? borderColor : disabledBorderColor, 1); var thumbBounds = (this.Checked) ? checkedThumbBounds : uncheckedThumbBounds; graphics2D.FillRectangle(thumbBounds, this.ThumbColor); graphics2D.Rectangle(thumbBounds, new Color(255, 255, 255, 90), 1); }
public override void OnDraw(Graphics2D graphics2D) { if (menuVisible) { graphics2D.FillRectangle(this.LocalBounds, HoverColor); } base.OnDraw(graphics2D); }
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); }
protected override void Paint(PPaintContext paintContext) { if (paintContext.Camera == lens.Camera) { Graphics2D g = paintContext.Graphics; g.FillRectangle(redBrush, Bounds); } else { base.Paint(paintContext); } }
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(); }
public override void Draw(Graphics2D g) { float opacity = timer / duration; if (type == FadeType.FadeIn) { opacity = 1.0f - opacity; } Color c = color * opacity; //c.A = (byte) (255.0f * opacity); g.FillRectangle(GameSettings.SCREEN_BOUNDS, c); }
/// <summary> /// This is called before the OnDraw method. /// When overriding OnPaintBackground in a derived class it is not necessary to call the base class's OnPaintBackground. /// </summary> /// <param name="graphics2D"></param> public virtual void OnDrawBackground(Graphics2D graphics2D) { if (BackgroundColor.Alpha0To255 > 0) { graphics2D.FillRectangle(LocalBounds, BackgroundColor); } }
public override void OnDraw(Graphics2D graphics2D) { RectangleDouble backgroundRect = new RectangleDouble(LocalBounds.Left - m_border_extra, LocalBounds.Bottom - m_border_extra, LocalBounds.Right + m_border_extra, LocalBounds.Top + m_border_extra); graphics2D.FillRectangle(backgroundRect, m_background_color); PathStorage border = new PathStorage(); border.LineTo(LocalBounds.Left, LocalBounds.Bottom); border.LineTo(LocalBounds.Right, LocalBounds.Bottom); border.LineTo(LocalBounds.Right, LocalBounds.Top); border.LineTo(LocalBounds.Left, LocalBounds.Top); border.LineTo(LocalBounds.Left + m_border_width, LocalBounds.Bottom + m_border_width); border.LineTo(LocalBounds.Left + m_border_width, LocalBounds.Top - m_border_width); border.LineTo(LocalBounds.Right - m_border_width, LocalBounds.Top - m_border_width); border.LineTo(LocalBounds.Right - m_border_width, LocalBounds.Bottom + m_border_width); graphics2D.Render(border, m_border_color); rewind(0); graphics2D.Render(this, m_curve_color); rewind(1); graphics2D.Render(this, m_grid_color); rewind(2); graphics2D.Render(this, m_inactive_pnt_color); rewind(3); graphics2D.Render(this, m_active_pnt_color); rewind(4); graphics2D.Render(this, m_text_color); base.OnDraw(graphics2D); }
public override void OnDraw(Graphics2D graphics2D) { base.OnDraw(graphics2D); if (content.OriginRelativeParent.y != 0) { graphics2D.FillRectangle(0, 0, Width, KeyboardHeight, RGBA_Bytes.Black); } }
public override void OnDraw(Graphics2D graphics2D) { graphics2D.FillRectangle(GetSwitchBounds(), BackgroundColor); base.OnDraw(graphics2D); if (startValue) { RectangleDouble interior = GetSwitchBounds(); interior.Inflate(-6); graphics2D.FillRectangle(interior, InteriorColor); } RectangleDouble border = GetSwitchBounds(); border.Inflate(-3); graphics2D.Rectangle(border, ExteriorColor, 1); graphics2D.FillRectangle(GetThumbBounds(), ThumbColor); graphics2D.Rectangle(GetThumbBounds(), new RGBA_Bytes(255, 255, 255, 90), 1); }
public void DoDrawBeforeChildren(Graphics2D graphics2D) { // erase to the background color graphics2D.FillRectangle(GetTotalBounds(), BackgroundColor); }