ClassLibraryWeiBao/QR二维码/Windows/Render/FixedCodeSize.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;

namespace Gma.QrCodeNet.Encoding.Windows.Render
{
    public class FixedCodeSize : ISizeCalculation
    {
        private int m_QrCodeWidth;

        private int m_QuietZoneModules = 2;

        /// <summary>
        /// QrCodeWidth is pixel size of QrCode you would like to print out. 
        /// It have to be greater than QrCode's matrix width(include quiet zone).
        /// QrCode matrix width is between 25 ~ 182(version 1 ~ 40).
        /// </summary>
        public int QrCodeWidth
        {
            get
            {
                return m_QrCodeWidth;
            }
            set
            {
                if (value <= 0)
                    throw new ArgumentOutOfRangeException("QrCodeWidth", value, "QrCodeWidth can not be equal or less than zero");
                m_QrCodeWidth = value;
            }
        }

        /// <summary>
        /// Number of quietZone modules
        /// </summary>
        public QuietZoneModules QuietZoneModules
        {
            get
            {
                return (QuietZoneModules)m_QuietZoneModules;
            }
            set
            {
                m_QuietZoneModules = (int)value;
            }
        }

        /// <summary>
        /// FixedCodeSize is strategy for rendering QrCode at fixed Size. 
        /// </summary>
        /// <param name="qrCodeWidth">Fixed size for QrCode pixel width. 
        /// Pixel width have to be bigger than QrCode's matrix width(include quiet zone)
        /// QrCode matrix width is between 25 ~ 182(version 1 ~ 40).</param>
        public FixedCodeSize(int qrCodeWidth, QuietZoneModules quietZone)
        {
            m_QrCodeWidth = qrCodeWidth;
            m_QuietZoneModules = (int)quietZone;
        }

        /// <summary>
        /// Interface function that use by Rendering class.
        /// </summary>
        /// <param name="matrixWidth">QrCode matrix width</param>
后面还有 8 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。