Ejemplo n.º 1
0
        /// <summary>
        /// Draws a Ellipse.
        /// </summary>
        /// <param name="pen">The Pen.</param>
        /// <param name="ellipse">The Ellipse.</param>
        public void DrawEllipse(Pen pen, Ellipse ellipse)
        {
            var dxPen = pen.Instance as DirectXPen;

            if (dxPen == null)
            {
                throw new ArgumentException("DirectX11 expects a DirectXPen as resource.");
            }
            DirectXHelper.RenderTarget.DrawEllipse(DirectXHelper.ConvertEllipse(ellipse), dxPen.GetPen(), dxPen.Width);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fills a Ellipse.
        /// </summary>
        /// <param name="color">The Color.</param>
        /// <param name="ellipse">The Ellipse.</param>
        public void FillEllipse(Color color, Ellipse ellipse)
        {
            var line = new Line(_direct3D9Device) {Antialias = false, Width = 2};
            line.Begin();

            line.Draw(DirectXHelper.ConvertToVertex(ellipse.Points), DirectXHelper.ConvertColor(color));

            line.End();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Draws a Ellipse.
        /// </summary>
        /// <param name="pen">The Pen.</param>
        /// <param name="ellipse">The Ellipse.</param>
        public void DrawEllipse(Pen pen, Ellipse ellipse)
        {
            var dxPen = pen.Instance as DirectXPen;
            if (dxPen == null) throw new ArgumentException("DirectX9 expects a DirectXPen as resource.");

            var line = new Line(_direct3D9Device) {Antialias = true, Width = dxPen.Width};
            line.Begin();

            line.Draw(DirectXHelper.ConvertToVertex(ellipse.Points), DirectXHelper.ConvertColor(dxPen.Color));

            line.End();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Fills a Ellipse.
 /// </summary>
 /// <param name="color">The Color.</param>
 /// <param name="ellipse">The Ellipse.</param>
 public void FillEllipse(Color color, Ellipse ellipse)
 {
     _renderTarget.FillEllipse(new SolidColorBrush(_renderTarget, DirectXHelper.ConvertColor(color)),
         DirectXHelper.ConvertEllipse(ellipse));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Draws a Ellipse.
        /// </summary>
        /// <param name="pen">The Pen.</param>
        /// <param name="ellipse">The Ellipse.</param>
        public void DrawEllipse(Pen pen, Ellipse ellipse)
        {
            var dxPen = pen.Instance as DirectXPen;
            if (dxPen == null) throw new ArgumentException("DirectX10 expects a DirectXPen as resource.");

            _renderTarget.DrawEllipse(dxPen.GetPen(), DirectXHelper.ConvertEllipse(ellipse));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Fills a Ellipse.
 /// </summary>
 /// <param name="color">The Color.</param>
 /// <param name="ellipse">The Ellipse.</param>
 public void FillEllipse(Color color, Ellipse ellipse)
 {
     _renderTarget.FillEllipse(new SolidColorBrush(_renderTarget, DirectXHelper.ConvertColor(color)),
                               DirectXHelper.ConvertEllipse(ellipse));
 }
Ejemplo n.º 7
0
 /// <summary>
 ///     Creates a new Polygon from ellipse.
 /// </summary>
 /// <param name="ellipse">The Ellipse.</param>
 /// <returns>Polygon.</returns>
 public static Polygon FromEllipse(Ellipse ellipse)
 {
     return new Polygon(ellipse.Points);
 }