public static double GetWidthInPixel(int width, int dpiX, bool cm) { double widthD = 0.0; if (cm) widthD = width / intocm; return ((double)((double)dpiX * widthD)); }