zoukankan      html  css  js  c++  java
  • C1Preview 毫米值转换为打印机像素值

            /// <summary>
            /// 转换单位(每英寸的毫米值)
            /// </summary>
            private const double MMPerInch = 25.4;
            /// <summary>
            /// 每百分之一inch=0.254mm
            /// </summary>
            private const float mmppi = 0.254f;
            /// <summary>
            /// 每mm=pipmm百分之一inch
            /// </summary>
            private const float pipmm = 3.937f;       
    
            /// <summary>
            /// 毫米值转换为打印机像素值
            /// </summary>
            /// <param name="value"></param>
            /// <returns></returns>
            private int ConvertMMToPixel(double value)
            {
                int rt = (int)Math.Round(value * pipmm * horizontalDPI / 100, 0);
                return rt;
            }
            /// <summary>
            /// 毫米值转换为打印机像素值,返回值为float型
            /// </summary>
            /// <param name="value"></param>
            /// <returns></returns>
            private float ConvertMMToPixel_F(double value)
            {
                float rt = (float)Math.Round(value * pipmm * horizontalDPI / 100, 5);
                return rt;
            }
  • 相关阅读:
    cmake使用
    CMake...
    信息熵相关知识总结
    最强NLP模型-BERT
    问答系统总结
    检索问答模型
    文本分类-TextCNN
    机器学习-Logistic回归
    Attention注意力机制介绍
    机器学习-聚类Clustering
  • 原文地址:https://www.cnblogs.com/LiCL/p/HEIMU360-KB000023.html
Copyright © 2011-2022 走看看