using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WMFConverter.Svg { /// /// Scalable Vector Graphics - SVG base object. /// public abstract class SvgObject { #region Local Variables private SvgGdi _gdi; #endregion #region Properties /// /// Gdi object instance. /// /// public SvgGdi GDI { get { return _gdi; } } #endregion #region Constructors /// /// Default constructor. /// /// public SvgObject(SvgGdi gdi) { _gdi = gdi; } #endregion #region Public Methods /// /// Convert to real size. /// /// /// public int ToRealSize(int px) { return GDI.DC.Dpi * px / 90; } /// /// Convert int color to rgb color. /// /// /// public static string ToColor(int color) { int b = (0x00FF0000 & color) >> 16; int g = (0x0000FF00 & color) >> 8; int r = (0x000000FF & color); return "rgb(" + r + "," + g + "," + b + ")"; } #endregion } }