private void Canvas_OnDraw(DXCanvas canvas, DXCanvas.Layer layer) { Vector scale = new Vector(1.0 / Scroll.Area.Width, 1.0 / Scroll.Area.Height); Matrix cameraView = new Matrix(scale.X, 0, 0, scale.Y, -scale.X * Scroll.Area.Location.X, -scale.Y * Scroll.Area.Location.Y); canvas.CameraView = cameraView; Scroll.Size = new Size(canvas.RenderCanvas.ClientSize.Width / RenderSettings.DpiScale.X, canvas.RenderCanvas.ClientSize.Height / RenderSettings.DpiScale.Y); OnDraw?.Invoke(canvas, layer, Scroll); }
private void Surface_OnDraw(DXCanvas canvas, DXCanvas.Layer layer, ZoomCanvas.ZoomScroll scroll) { switch (layer) { case DXCanvas.Layer.Normal: foreach (Track track in Tracks) { track.Draw(canvas, layer, Board, scroll); } break; } }
public override void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll, Vector offset) { canvas.Draw(Mesh); canvas.Draw(Lines); Segment unitBox = NormalizeTime(DataContext, board); double unitThreashold = scroll.ToUnitLength(TextDrawLimit); foreach (TextEntry block in TextBlocks) { double blockWidth = scroll.ToPixelLength(unitBox.Length * block.Width); if (blockWidth < TextDrawLimit) { break; } Point pixelPos = new Point(scroll.ToPixel(unitBox.Start + unitBox.Length * block.Position.X) + TextOffset, offset.Y + block.Position.Y * MaxHeight); canvas.Text.Draw(pixelPos, block.Text, Colors.Black, TextAlignment.Left, blockWidth); } }
internal void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll) { Children.ForEach(item => item.Draw(canvas, layer, board, scroll, Offset)); }
public override void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll, Vector offset) { canvas.Draw(Mesh); canvas.Draw(Lines); }
public abstract void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll, Vector offset);