Svg.SvgUnit.GetDeviceSize C# (CSharp) Method

GetDeviceSize() public static method

public static GetDeviceSize ( SvgUnit width, SvgUnit height, ISvgRenderer renderer, SvgElement owner ) : SizeF
width SvgUnit
height SvgUnit
renderer ISvgRenderer
owner SvgElement
return System.Drawing.SizeF
        public static System.Drawing.SizeF GetDeviceSize(SvgUnit width, SvgUnit height, ISvgRenderer renderer, SvgElement owner)
        {
            return new System.Drawing.SizeF(width.ToDeviceValue(renderer, UnitRenderingType.HorizontalOffset, owner),
                                            height.ToDeviceValue(renderer, UnitRenderingType.VerticalOffset, owner));
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Gets the <see cref="GraphicsPath"/> for this element.
        /// </summary>
        public override GraphicsPath Path(ISvgRenderer renderer)
        {
            if (_path == null)
            {
                // Same size of rectangle can suffice to provide bounds of the image
                var rectangle = new RectangleF(Location.ToDeviceValue(renderer, this),
                                               SvgUnit.GetDeviceSize(Width, Height, renderer, this));

                _path = new GraphicsPath();
                _path.StartFigure();
                _path.AddRectangle(rectangle);
                _path.CloseFigure();
            }

            return(_path);
        }
All Usage Examples Of Svg.SvgUnit::GetDeviceSize