Example #1
0
 protected override void PaintNonGrouped(float cx, float cy, ICanvas canvas)
 {
     var res = Renderer.Resources;
     canvas.Font = res.EffectFont;
     canvas.TextAlign = TextAlign.Left;
     canvas.FillText(_label, cx + X, cy + Y);
 }
Example #2
0
        protected override void PaintGrouped(float cx, float cy, float endX, ICanvas canvas)
        {
            PaintNonGrouped(cx, cy, canvas);

            var lineSpacing = LineSpacing * Scale;
            var textWidth = canvas.MeasureText(_label);
            var startX = cx + X + textWidth + lineSpacing;
            var lineY = cy + Y + (LineTopPadding * Scale);
            var lineSize = LineSize * Scale;

            if (endX > startX)
            {
                var lineX = startX;
                while (lineX < endX)
                {
                    canvas.BeginPath();
                    canvas.MoveTo(lineX, (int)lineY);
                    canvas.LineTo(Math.Min(lineX + lineSize, endX), (int)lineY);
                    lineX += lineSize + lineSpacing;
                    canvas.Stroke();
                }
                canvas.BeginPath();
                canvas.MoveTo(endX, (int)(lineY - LineTopOffset * Scale));
                canvas.LineTo(endX, (int)(lineY + LineTopOffset * Scale));
                canvas.Stroke();
            }
        }
Example #3
0
        public override void Draw(ICanvas canvas, RectangleF unitrect)
        {
            Color color = Color;
            Pen pen = canvas.CreatePen(color, Width);
            if (Highlighted || Selected)
            {
                pen = Canvas.DrawTools.DrawUtils.SelectedPen;
                if (m_p1.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p1);
                if (m_p2.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p2);
                //if ((m_p3.X != m_p2.X + 1 || m_p3.Y != m_p2.Y) && this.horizontal) m_p3 = new UnitPoint(m_p2.X + 1, m_p2.Y);
                //if (m_p3.Y != m_p2.Y + 1 && !this.horizontal) m_p3 = new UnitPoint(m_p2.X, m_p2.Y + 1);
                if (m_p3.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p3);
                if (m_p4.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p4);
            }
            canvas.DrawLine(canvas, pen, m_p1, m_p2);
            pen = new Pen(pen.Color, (float)4);

            if (horizontal)
            {
                canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.1, m_p2.Y), new UnitPoint(m_p2.X + 0.51, m_p2.Y + 0.4));
                canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.9, m_p2.Y), new UnitPoint(m_p2.X + 0.49, m_p2.Y + 0.4));
                canvas.Graphics.DrawRectangle(pen, canvas.ToScreen(new UnitPoint(m_p2.X + 0.2, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y + 0.1)).Y, canvas.ToScreen(new UnitPoint(m_p2.X + 0.8, 1)).X - canvas.ToScreen(new UnitPoint(m_p2.X + 0.2, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.6)).Y - canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.1)).Y);
            }
            else
            {
                canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X - 0.4, m_p2.Y-0.5), new UnitPoint(m_p2.X + 0.01, m_p2.Y ));
                canvas.DrawLine(canvas, pen, new UnitPoint(m_p2.X + 0.4, m_p2.Y-0.5), new UnitPoint(m_p2.X + -0.01, m_p2.Y ));
                canvas.Graphics.DrawRectangle(pen, canvas.ToScreen(new UnitPoint(m_p2.X - 0.3, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.4)).Y, canvas.ToScreen(new UnitPoint(m_p2.X + 0.8, 1)).X - canvas.ToScreen(new UnitPoint(m_p2.X + 0.2, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.6)).Y - canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.1)).Y);

            }
        }
Example #4
0
        public override void Draw(ICanvas canvas, RectangleF unitrect)
        {
            Color color = Color;
            Brush B = Brushes.Black;
            Pen pen = canvas.CreatePen(color, Width);
            if (Highlighted || Selected)
            {
                pen = Canvas.DrawTools.DrawUtils.SelectedPen;
                if (m_p1.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p1);
                if (m_p2.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p2);
                if (m_p3.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p3);
                B = Brushes.Magenta;
            }
            canvas.DrawLine(canvas, pen, m_p1, m_p2);
            pen = new Pen(pen.Color, (float)3);
            if (horizontal)
            {
                canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X + 0.2, m_p2.Y));
                canvas.Graphics.DrawRectangle(pen, canvas.ToScreen(new UnitPoint(m_p2.X + 0.2, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y + 0.1)).Y, canvas.ToScreen(m_p3).X - canvas.ToScreen(new UnitPoint(m_p2.X + 0.2, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.1)).Y - canvas.ToScreen(new UnitPoint(1, m_p2.Y + 0.1)).Y);
                float size = (canvas.ToScreen(new UnitPoint(m_p1.X + 1, m_p1.Y)).X - canvas.ToScreen(m_p1).X) / 10;
                Font m_font = new System.Drawing.Font("Arial Black", size, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                canvas.Graphics.DrawString("Recorder", m_font, B, canvas.ToScreen(new UnitPoint(m_p2.X + 0.25, m_p2.Y - 0.1)).X, canvas.ToScreen(new UnitPoint(m_p2.X - 0.3, m_p2.Y + 0.1)).Y);

            }
            else
            {
                canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X, m_p2.Y - 0.2));
                canvas.Graphics.DrawRectangle(pen, canvas.ToScreen(new UnitPoint(m_p2.X - 0.4, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.2)).Y, canvas.ToScreen(new UnitPoint(m_p2.X + 0.4, 1)).X - canvas.ToScreen(new UnitPoint(m_p2.X - 0.4, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.4)).Y - canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.2)).Y);
                float size = (canvas.ToScreen(new UnitPoint(m_p1.X + 1, m_p1.Y)).X - canvas.ToScreen(m_p1).X) / 10;
                Font m_font = new System.Drawing.Font("Arial Black", size, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                canvas.Graphics.DrawString("Recorder", m_font, B, canvas.ToScreen(new UnitPoint(m_p2.X - 0.35, 1)).X, canvas.ToScreen(new UnitPoint(1, m_p2.Y - 0.2)).Y);
            }
        }
Example #5
0
        public override void InitializeScene(ICanvas canvas)
        {
            // Connect with simulator
            connection = new NetworkClient();
            if (!connection.Connect("ganberg2", 9999))
            {
                throw new ApplicationException("Unable to establish connection with host.");
            }
            else
            {
                connection.Subscribe("TimeTick");
                connection.Subscribe("ViewProUpdate");
            }

            // Create and initialize Gameboard.
            background = new Obj_Sprite(texture_file, SpriteFlags.SortTexture | SpriteFlags.AlphaBlend);
            background.Initialize(canvas);
            background.Position = new Vector3(0, 0, 0);
            background.Rotation = new Vector3(0, 0, 0);
            background.Scaling = new Vector3(1, 1, 1);
            background.Texture(canvas);

            // Initialize and create Font;
            this._myFont = canvas.CreateFont(new System.Drawing.Font("Arial", 10));
            message = string.Empty;

            //f16 = new Obj_Sprite("f16.png", SpriteFlags.AlphaBlend);
            //f16.Initialize(canvas);
            //f16.Texture(canvas);
            //f16.Position = new Vector3(0, 0, 0);
            //f16.Rotation = new Vector3(0, 0, 0);
            //f16.Scaling = new Vector3(1, 1, 1);

        }
        public static void Reconnect(ICanvas canvas,
            ILine line, IElement splitPin,
            double x, double y,
            List<Connection> connections,
            ILine currentLine,
            IDiagramCreator creator)
        {
            var wire1 = connections[0].Wires.FirstOrDefault();
            var wire2 = connections[1].Wires.FirstOrDefault();
            var startRoot = (wire1.Start != null ? wire1.Start : wire2.Start) as IElement;
            var endRoot = (wire1.End != null ? wire1.End : wire2.End) as IElement;

            PointEx start;
            PointEx end;
            GetLocation(wire1, wire2, out start, out end);

            if (start != null && end != null)
            {
                var startLine = Connect(canvas, startRoot, currentLine, start.X, start.Y, creator);
                var splitLine = Connect(canvas, splitPin, startLine, x, y, creator);
                var endLine = Connect(canvas, splitPin, splitLine, x, y, creator);

                Connect(canvas, endRoot, endLine, start.X + end.X, start.Y + end.Y, creator);

                startLine.SetStartVisible(line.GetStartVisible());
                startLine.SetStartIO(line.GetStartIO());
                endLine.SetEndVisible(line.GetEndVisible());
                endLine.SetEndIO(line.GetEndIO());
            }
            else
            {
                throw new InvalidOperationException("LineEx must have Start and End points.");
            }
        }
Example #7
0
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            // if we are linked with the previous, the first glyph of the group will also render this one.
            if (IsLinkedWithPrevious)
            {
                return;
            }

            // we are not linked with any glyph therefore no expansion is required, we render a simple glyph.
            if (!IsLinkedWithNext)
            {
                PaintNonGrouped(cx, cy, canvas);
                return;
            }

            // find last linked glyph that can be
            var lastLinkedGlyph = (GroupedEffectGlyph)NextGlyph;
            while (lastLinkedGlyph.IsLinkedWithNext)
            {
                lastLinkedGlyph = (GroupedEffectGlyph)lastLinkedGlyph.NextGlyph;
            }

            // calculate end X-position

            var cxRenderer = cx - Renderer.X;

            var endRenderer = lastLinkedGlyph.Renderer;
            var endBeatX = endRenderer.GetBeatX(lastLinkedGlyph.Beat, _endPosition);
            var endX = cxRenderer + endRenderer.X + endBeatX;

            PaintGrouped(cx, cy, endX, canvas);
        }
 public void WhenBeingDraggedOverEditor(ICanvas canvas, DraggingContext draggingContext)
 {
     if (_whenDraggingOverEditor != null)
     {
         _whenDraggingOverEditor(canvas, draggingContext);
     }
 }
Example #9
0
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            // calculate offsets per step
            var dX = Width / BendPoint.MaxPosition;
            var maxValue = 0;
            for (int i = 0, j = _note.BendPoints.Count; i < j; i++)
            {
                if (_note.BendPoints[i].Value > maxValue)
                {
                    maxValue = _note.BendPoints[i].Value;
                }
            }

            cx += X;
            cy += Y;

            canvas.BeginPath();
            for (int i = 0, j = _note.BendPoints.Count - 1; i < j; i++)
            {
                var firstPt = _note.BendPoints[i];
                var secondPt = _note.BendPoints[i + 1];

                // draw pre-bend if previous
                if (i == 0 && firstPt.Value != 0 && !_note.IsTieDestination)
                {
                    PaintBend(new BendPoint(), firstPt, cx, cy, dX, canvas);
                }

                // don't draw a line if there's no offset and it's the last point
                if (firstPt.Value == secondPt.Value && i == _note.BendPoints.Count - 2) continue;

                PaintBend(firstPt, secondPt,  cx, cy, dX, canvas);
            }
        }
 public void WhenEnteringEditor( ICanvas canvas, DraggingContext context)
 {
     if (_whenEnteringEditor != null)
     {
         _whenEnteringEditor(context);
     }
 }
 public void WhenDroppedOntoEditor(ICanvas canvas, DraggingContext context)
 {
     if( _whenDroppedOntoEditor !=null )
     {
         _whenDroppedOntoEditor( canvas, context ) ;
     }
 }
Example #12
0
        public WinFormsCanvas(ICanvas canvas, WinFormsCanvasPanel panel)
        {
            Background = canvas.Background;
            SnapX = canvas.SnapX;
            SnapY = canvas.SnapY;
            EnableSnap = canvas.EnableSnap;

            History = canvas.History;

            Children = new List<INative>();

            _panel = panel;
            _panel.Layers.Add(this);

            Downs = Observable.FromEventPattern<MouseEventArgs>(_panel, "MouseDown")
                .Where(e => e.EventArgs.Button == MouseButtons.Left)
                .Select(e => Snap(e.EventArgs.Location));

            Ups = Observable.FromEventPattern<MouseEventArgs>(_panel, "MouseUp")
                .Where(e => e.EventArgs.Button == MouseButtons.Left)
                .Select(e => Snap(e.EventArgs.Location));

            Moves = Observable.FromEventPattern<MouseEventArgs>(_panel, "MouseMove")
                .Select(e => Snap(e.EventArgs.Location));

            Native = _panel;
        }
Example #13
0
 protected override void DrawElement(ICanvas canvas)
 {
     foreach (var c in Children)
     {
         c.Draw(canvas);
     }
 }
Example #14
0
        public override void Draw(ICanvas canvas, RectangleF unitrect)
        {
            Color color = Color;
            Pen pen = canvas.CreatePen(color, Width);
            if (Highlighted || Selected)
            {
                pen = Canvas.DrawTools.DrawUtils.SelectedPen;
                if (m_p1.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p1);
                if (m_p2.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p2);
                if (m_p3.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p3);
                if (m_p4.IsEmpty == false) Canvas.DrawTools.DrawUtils.DrawNode(canvas, m_p4);
            }
            canvas.DrawLine(canvas, pen, m_p1, m_p2);
            if (m_p3 != m_p4) canvas.DrawLine(canvas, pen, m_p3, m_p4);
            pen = new Pen(pen.Color, (float)3);
            if (horizontal)
            {
                canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X+0.2,m_p2.Y));
                canvas.DrawLine(canvas, pen, m_p3, new UnitPoint(m_p2.X + 0.8, m_p2.Y));
                canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.61, m_p2.Y), (float)0.19, 0, 360);
                canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X + 0.39, m_p2.Y), (float)0.19, 0, 360);

            }
            else
            {
                canvas.DrawLine(canvas, pen, m_p2, new UnitPoint(m_p2.X , m_p2.Y- 0.2));
                canvas.DrawLine(canvas, pen, m_p3, new UnitPoint(m_p2.X , m_p2.Y- 0.8));
                canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X , m_p2.Y-0.61), (float)0.19, 0, 360);
                canvas.DrawArc(canvas, pen, new UnitPoint(m_p2.X , m_p2.Y-0.39), (float)0.19, 0, 360);
            }
        }
Example #15
0
        /// <summary>
        /// Manages a scene to be rendered and updated.
        /// </summary>
        /// <param name="camera">Camera of the scene</param>
        /// <param name="canvas">Canvas that this scene binds to.</param>
        /// <param name="objects">Objects to be rendered</param>
        public Scene(ICamera camera, ICanvas canvas, params SceneObject[] objects)
        {
            if (camera == null || canvas == null) { throw new ArgumentNullException(); }

            this.Canvas = canvas;
            {
                this.rootUI = new SceneRootUI();
            }
            {
                var rootObject = new SceneRootObject(this);
                rootObject.Children.AddRange(objects);
                this.rootObject = rootObject;
            }
            {
                var rootViewPort = new SceneRootViewPort(
                     AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top, new Padding(0, 0, 0, 0), canvas.Size);
                rootViewPort.Children.Add(new ViewPort(camera,
                    AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom,
                    new Padding(0, 0, 0, 0), canvas.Size));
                this.rootViewPort = rootViewPort;
            }
            //var cursor = UICursor.CreateDefault();
            //cursor.Enabled = false;
            //this.rootCursor.Children.Add(cursor);
            //this.Cursor = cursor;
        }
        public bool Clip(ICanvas canvas, CRectangleF clipRect)
        {
            if (canvas.Bound.Left < clipRect.Left)
            {
                canvas.Bound.Left = clipRect.Left;
                canvas.Content.Left = clipRect.Left - canvas.Bound.Left;
            }

            if (canvas.Bound.Top < clipRect.Top)
            {
                canvas.Bound.Top = clipRect.Top;
                canvas.Content.Top = clipRect.Top - canvas.Bound.Top;
            }

            if (canvas.Bound.Right < clipRect.Right)
            {
                canvas.Bound.Right = clipRect.Right;
                canvas.Content.Right = clipRect.Right - canvas.Bound.Right;
            }

            if (canvas.Bound.Bottom < clipRect.Bottom)
            {
                canvas.Bound.Bottom = clipRect.Bottom;
                canvas.Content.Bottom = clipRect.Bottom - canvas.Bound.Bottom;
            }

            return !canvas.Bound.IsEmpty;
        }
Example #17
0
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var blockWidth = 4 * Scale;

            var top = cy + Y + Renderer.TopPadding;
            var bottom = cy + Y + Renderer.Height - Renderer.BottomPadding;
            var left = cx + X + 0.5f;
            // big bar
            var h = bottom - top;
            canvas.FillRect(left, top, blockWidth, h);

            // line
            left += (blockWidth * 2) - 0.5f;
            canvas.BeginPath();
            canvas.MoveTo(left, top);
            canvas.LineTo(left, bottom);
            canvas.Stroke();

            //circles 
            left += 3 * Scale;

            var circleSize = _circleSize * Scale;
            var middle = (top + bottom) / 2;
            canvas.FillCircle(left, middle - (circleSize * _dotOffset), circleSize);
            canvas.FillCircle(left, middle + (circleSize * _dotOffset), circleSize);
        }
Example #18
0
 public override void Paint(float cx, float cy, ICanvas canvas)
 {
     if (_noteString != null)
     {
         canvas.FillText(_noteString.ToLower(), cx + X, cy + Y);
     }
 }
Example #19
0
        public void Draw(ICanvas canvas)
        {
            canvas.SaveState ();

            //
            // Scale the viewBox into the size
            //
            var sx = 1.0;
            if (ViewBox.Width > 0) {
                sx = Size.Width / ViewBox.Width;
            }
            var sy = 1.0;
            if (ViewBox.Height > 0) {
                sy = Size.Height / ViewBox.Height;
            }

            canvas.Scale (sx, sy);
            canvas.Translate (-ViewBox.X, -ViewBox.Y);

            //
            // Draw
            //
            foreach (var c in Children) {
                c.Draw (canvas);
            }

            canvas.RestoreState ();
        }
Example #20
0
 public void Save(string path, ICanvas canvas)
 {
     using (var document = new PdfDocument())
     {
         AddPage(document, canvas);
         document.Save(path);
     }
 }
Example #21
0
       public Scene[] InitializeScenes(ICanvas canvas)
       {
           //levels = new Scene[] { new MainScene(), new Scene1() };
           levels = new Scene[] { new GIS_Scene("test.jpg", 8.49990671075954650f, 8.56718696599567760f), new Scene1() };
           return levels;
           //return new IScene[] { new MainScene() };

       }
Example #22
0
 public void Draw(ICanvas canvas, RectangleF unitrect)
 {
     RectangleF r = ScreenUtils.ToScreenNormalized(canvas, unitrect);
     canvas.Graphics.FillRectangle(m_backgroundBrush, r);
     StringFormat f = new StringFormat();
     f.Alignment = StringAlignment.Center;
     PointF centerpoint = new PointF(r.Width / 2, r.Height / 2);
 }
Example #23
0
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var res = Renderer.Resources;
            canvas.Font = res.MarkerFont;

            canvas.FillMusicFontSymbol(cx+ X, cy + Y, 1, MusicFontSymbol.Tempo);
            canvas.FillText("" + _tempo, cx + X + (20 * Scale), cy + X + (7 * Scale));
        }
Example #24
0
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var res = Renderer.Resources;
            canvas.Font = res.MarkerFont;

            canvas.FillMusicFontSymbol(cx + X, cy + Y + Renderer.Height * 0.75f, 0.75f, MusicFontSymbol.Tempo);
            canvas.FillText("= " + _tempo, cx + X + (15 * Scale), cy + Y + canvas.Font.Size / 2);
        }
Example #25
0
        // method
        public override void Draw(ICanvas canvas)
        {
            if (_frame == null)
                return;

            canvas.Draw(_frame, _internalPosition, ResultColor, _internalOrigin, Scale * _internalScale,
                Rotation, Effet);
        }
Example #26
0
 public void OnKeyDown(ICanvas canvas, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.L)
     {
         m_angleLocked = !m_angleLocked;
         e.Handled = true;
     }
 }
Example #27
0
 public override void Paint(float cx, float cy, ICanvas canvas)
 {
     var res = Renderer.Resources;
     canvas.Color = res.MainGlyphColor;
     canvas.StrokeRect(cx + X, cy + Y, Width, 20 * Scale);
     canvas.Font = res.TablatureFont;
     canvas.FillText(_s, cx + X, cy + Y);
 }
Example #28
0
 public override void Paint(float cx, float cy, ICanvas canvas)
 {
     canvas.Font = Font;
     var old = canvas.TextAlign;
     canvas.TextAlign = TextAlign;
     canvas.FillText(_text, cx + X, cy + Y);
     canvas.TextAlign = old;
 }
Example #29
0
 /// <summary>
 /// Initialize a basic figure along with its handles
 /// </summary>
 /// <param name="canvas">the associated canvas</param>
 /// <param name="location">the location of the figure</param>
 /// <param name="size">the size of the figure</param>
 public BasicFigure(ICanvas canvas, Point location, Size size)
 {
     this._canvas = canvas;
     this._location = location;
     this._size = size;
     this._handles = new List<IHandle>();
     _handles.Add(new Basic.LocatorHandle(new Locator.ProportionalLocator(this), _canvas));
     _handles.Add(new Figure.Line.ConnectorHandle(new Locator.ProportionalLocator(this, 0.33f, 0.33f), _canvas, this));
 }
Example #30
0
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var res = Renderer.Resources;
            canvas.Font = res.BarNumberFont;

            var s = "x" + _count;
            var w = canvas.MeasureText(s)/1.5f;
            canvas.FillText(s, cx + X - w, cy + Y);
        }
Example #31
0
 public void Draw(ICanvas c)
 {
     c.DrawLine(this);
 }
 public override void Draw(ICanvas canvas)
 {
 }
Example #33
0
 public abstract void Draw(ICanvas canvas);
 public override void UnExecute(ICanvas canvas)
 {
     canvas.Layers[this.LayerIndex].VObjects.Move(_newVObjectIndex, _oldVObjectIndex);
 }
Example #35
0
 /// <summary>
 /// Calculates wheel sensitivity.
 /// </summary>
 /// <param name="canvas"></param>
 /// <returns></returns>
 public float CalcWheelSensitivity(ICanvas canvas)
 {
     return(wheelSensitivity.CanvasCoordinate +
            wheelSensitivity.PixelCoordinate * canvas.CanvasUnitSize.X / (float)canvas.CanvasPixelSize.Y);
 }
Example #36
0
 public void Draw(ICanvas canvas)
 {
     this.Sprite.Draw(canvas);
 }
Example #37
0
 private void DrawHorizontal(ICanvas canvas)
 {
     canvas.DrawPath(_horizontalPlankPath, _plankPaint);
     DrawHorizontalTracks(canvas);
 }
Example #38
0
 private void DrawHorizontalTracks(ICanvas canvas)
 {
     canvas.DrawPath(_horizontalTrackPath, _trackEdge);
     canvas.DrawPath(_horizontalTrackPath, _trackClear);
 }
 public void Draw(ICanvas canvas)
 {
     canvas.Draw(_tileSprite);
 }
Example #40
0
 public void OnKeyDown(ICanvas canvas, KeyEventArgs e)
 {
 }
Example #41
0
 public void Draw(ICanvas canvas, RectangleF dirtyRect)
 {
     canvas.DrawImage(this, dirtyRect.Left, dirtyRect.Top, (float)Math.Round(dirtyRect.Width), (float)Math.Round(dirtyRect.Height));
 }
Example #42
0
 protected override void DrawElement(ICanvas canvas)
 {
     canvas.DrawPath(Operations, Pen, Brush);
 }
Example #43
0
 public void Draw(ICanvas canvas)
 {
     canvas.Draw(this._rectangleContext);
 }
 public BlackCanvasbgCommand(ICanvas canvas)
 {
     this.canvas = canvas;
 }
 protected abstract void Render(ICanvas canvas, TRenderType item);
Example #46
0
 public EndButton()
 {
     _endCanvas = new EndCanvas();
 }
Example #47
0
 public virtual void DrawText(ICanvas canvas, RectangleF dirtyRect, ISlider text)
 {
 }
Example #48
0
 public StartButton()
 {
     _startCanvas = new StartCanvas();
 }
 public CreateDrawingObjectCommand(IDrawingObject obj, ICanvas canvas)
 {
     this.obj    = obj;
     this.canvas = canvas;
 }
Example #50
0
 private void DrawCornerTrack(ICanvas canvas)
 {
     canvas.DrawPath(_cornerTrackPath, _trackEdge);
     canvas.DrawPath(_cornerTrackPath, _trackClear);
 }
 public abstract void Plot(Vector2Int position, ICanvas canvas);
Example #52
0
 public OffsetCanvas(ICanvas canvas, int xOffset, int yOffset)
 {
     this.canvas  = canvas;
     this.xOffset = xOffset;
     this.yOffset = yOffset;
 }
Example #53
0
 protected void SetParametersInCanvas(ICanvas canvas)
 {
     canvas.BeginFill(FillStyle.GetColor().Value);
     canvas.SetLineColor(OutlineStyle.GetColor().Value);
     canvas.SetLineThickness(OutlineStyle.GetLineThickness().Value);
 }
Example #54
0
 public void IllegalAccess(ICanvas canvas)
 {
 }
Example #55
0
        public void Render(ICanvas canvas)
        {
            if (_width == 0 || _height == 0)
            {
                return;
            }

            _skiaDrawTime.Start();
            if (canvas is null)
            {
                throw new ArgumentNullException(nameof(canvas));
            }

            canvas.Save();
            canvas.Clear(Colors.VeryLightGray);

            foreach (ILayerRenderer renderer in _boardRenderers)
            {
                if (!renderer.Enabled)
                {
                    continue;
                }
                canvas.Save();

                if (renderer is ICachableLayerRenderer cachable)
                {
                    if (cachable.IsDirty || !_bitmapBuffer.ContainsKey(renderer))
                    {
                        if (!_bitmapBuffer.TryGetValue(renderer, out IBitmap bitmap))
                        {
                            bitmap = _bitmapFactory.CreateBitmap(_width, _height);
                        }
                        ICanvas layerCanvas = _bitmapFactory.CreateCanvas(bitmap);
                        layerCanvas.Clear(Colors.Empty);
                        RenderLayer(renderer, layerCanvas);
                        _bitmapBuffer[renderer] = bitmap;
                        layerCanvas.Dispose();
                    }

                    canvas.DrawBitmap(_bitmapBuffer[renderer], 0, 0);
                }
                else
                {
                    RenderLayer(renderer, canvas);
                }
                canvas.Restore();
            }
            canvas.Restore();

            if (_needsBufferReset)
            {
                ResetBuffers();
                _needsBufferReset = false;
            }

            _skiaDrawTime.Stop();
            _skiaFps.Update();

            void RenderLayer(ILayerRenderer renderer, ICanvas layerCanvas)
            {
                _renderLayerDrawTimes[renderer].Start();
                renderer.Render(layerCanvas, _width, _height);
                _renderLayerDrawTimes[renderer].Stop();
            }
        }
Example #56
0
 public AddCompositePattern(ICanvas canvas) : base(canvas)
 {
     setCanvas(canvas);
 }
Example #57
0
 public SlowCar(StartCanvas canvas)
 {
     _canvas = canvas;
 }
Example #58
0
 public void CreatePicture(IPainter painter, ICanvas canvas)
 {
     painter.DrawPicture(_pictureDraft, canvas);
 }
 public override void Draw(ICanvas canvas)
 {
     _picture.Draw(canvas);
 }
Example #60
0
 public DeleteClass(List <Vertex> vertexs, ICanvas canvas)
 {
     this.vertexs = vertexs;
     this.canvas  = canvas;
     removeRedoStack();
 }