Example #1
0
        /// <summary>
        /// Fills the given geometry.
        /// </summary>
        public void FillGeometry(Geometry2DResourceBase geometry, BrushResource brush)
        {
            if (_renderTarget == null)
            {
                return;
            }

            geometry.EnsureNotNullOrDisposed(nameof(geometry));
            brush.EnsureNotNull(nameof(brush));

            _renderTarget.FillGeometry(
                geometry.GetGeometry(),
                brush.GetBrush(this.Device));
        }
Example #2
0
        /// <summary>
        /// Draws the given geometry.
        /// </summary>
        public void DrawGeometry(Geometry2DResourceBase geometry, BrushResource brush, float strokeWidth = 1f)
        {
            if (_renderTarget == null)
            {
                return;
            }

            geometry.EnsureNotNullOrDisposed(nameof(geometry));
            brush.EnsureNotNull(nameof(brush));
            strokeWidth.EnsurePositiveOrZero(nameof(strokeWidth));

            _renderTarget.DrawGeometry(
                geometry.GetGeometry(),
                brush.GetBrush(this.Device),
                strokeWidth);
        }