Beispiel #1
0
        private void Draw(Bitmap bitmap, GeometryShader2D shader, Matrix4x4 transform)
        {
            var geometries = new List <IMarkGeometry>();

            var border = (MarkGeometryRectangle)Boundary.Clone();

            border.Stroke = Color.White;

            border.Transform(transform);
            geometries.Add(border);

            // apply transformation to geometries
            foreach (var line in Segments)
            {
                var geometry = ((IMarkGeometry)line.Clone());
                geometry.Transform(transform);
                geometries.Add(geometry);
            }

            // draw used cells in red
            shader.Draw(
                bitmap,
                geometries
                );

            if (ChildrenExists)
            {
                NorthWest.Draw(bitmap, shader, transform);
                NorthEast.Draw(bitmap, shader, transform);
                SouthWest.Draw(bitmap, shader, transform);
                SouthEast.Draw(bitmap, shader, transform);
            }
        }
Beispiel #2
0
        public void Draw(Graphics graphics)
        {
            Pen pen = Pens.Black;

            graphics.DrawRectangle(pen, Bounds);

            if (Point != null)
            {
                Point.Draw(graphics);
            }

            if (NorthWest != null)
            {
                NorthWest.Draw(graphics);
            }
            if (NorthEast != null)
            {
                NorthEast.Draw(graphics);
            }
            if (SouthWest != null)
            {
                SouthWest.Draw(graphics);
            }
            if (SouthEast != null)
            {
                SouthEast.Draw(graphics);
            }
        }