Example #1
0
        /// <summary>
        /// Fills the given ellipse with the given brush.
        /// </summary>
        public void FillEllipse(Vector2 center, float radiusX, float radiusY, BrushResource brush)
        {
            var ellipse = new D2D.Ellipse(MathConverter.RawFromVector2(center), radiusX, radiusY);

            _renderTarget.FillEllipse(
                ellipse,
                brush.GetBrush(this.Device));
        }
Example #2
0
        /// <summary>
        /// Draws the given ellipse with the given brush.
        /// </summary>
        public void DrawEllipse(Vector2 center, float radiusX, float radiusY, BrushResource brush, float strokeWidth = 1f)
        {
            var ellipse = new D2D.Ellipse(MathConverter.RawFromVector2(center), radiusX, radiusY);

            _renderTarget.DrawEllipse(
                ellipse,
                brush.GetBrush(this.Device),
                strokeWidth);
        }
Example #3
0
        /// <summary>
        /// Fills the given ellipse with the given brush.
        /// </summary>
        public void FillEllipse(RectangleF rectangle, BrushResource brush)
        {
            var radiusX = rectangle.Width / 2f;
            var radiusY = rectangle.Height / 2f;
            var center  = new Vector2(
                rectangle.X + radiusX,
                rectangle.Y + radiusY);
            var ellipse = new D2D.Ellipse(MathConverter.RawFromVector2(center), radiusX, radiusY);

            _renderTarget.FillEllipse(
                ellipse,
                brush.GetBrush(this.Device));
        }
Example #4
0
 /// <summary>
 /// Draws the outline of the specified ellipse using the brush and stroke width.
 /// </summary>
 /// <param name="ellipse">The position and radius of the ellipse to draw, in device-independent pixels. </param>
 /// <param name="brush">The brush used to paint the ellipse's outline. </param>
 /// <param name="strokeWidth">The thickness of the ellipse's stroke. The stroke is centered on the ellipse's outline. </param>
 public void DrawEllipse(Ellipse ellipse, ID2D1Brush brush, float strokeWidth)
 {
     DrawEllipse(ellipse, brush, strokeWidth, null);
 }
Example #5
0
 /// <summary>
 /// Draws the outline of the specified ellipse using the specified brush.
 /// </summary>
 /// <param name="ellipse">The position and radius of the ellipse to draw, in device-independent pixels.</param>
 /// <param name="brush">The brush used to paint the ellipse's outline.</param>
 public void DrawEllipse(Ellipse ellipse, ID2D1Brush brush)
 {
     DrawEllipse(ellipse, brush, 1.0f, null);
 }