ClassLibraryWeiBao/QR二维码/Windows/WPF/QrCodeImgControl.cs

(开头部分) 11KB

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

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.ComponentModel;
using Gma.QrCodeNet.Encoding.Windows.Render;

namespace Gma.QrCodeNet.Encoding.Windows.WPF
{
    public class QrCodeImgControl : Control
    {
        private QrCode m_QrCode = new QrCode();
        private bool m_isLocked = false;
        private bool m_isFreezed = false;

        public event EventHandler QrMatrixChanged;

        #region WBitmap
        public static readonly DependencyProperty WBitmapProperty =
            DependencyProperty.Register("WBitmap",
            typeof(WriteableBitmap),
            typeof(QrCodeImgControl),
            new UIPropertyMetadata(null, null));

        public WriteableBitmap WBitmap
        {
            get { return (WriteableBitmap)GetValue(WBitmapProperty); }
            private set { SetValue(WBitmapProperty, value); }
        }
        #endregion

        #region QrCodeWidthInch
        public static readonly DependencyProperty QrCodeWidthInchProperty =
            DependencyProperty.Register("QrCodeWidth", typeof(double), typeof(QrCodeImgControl),
            new UIPropertyMetadata(2.08, new PropertyChangedCallback(OnVisualValueChanged)));

        [Browsable(true), EditorBrowsable(EditorBrowsableState.Always), Category("QrCode")]
        public double QrCodeWidthInch
        {
            get { return (double)GetValue(QrCodeWidthInchProperty); }
            set { SetValue(QrCodeWidthInchProperty, value); }
        }

        #endregion

        #region QuietZoneModule
        public static readonly DependencyProperty QuietZoneModuleProperty =
            DependencyProperty.Register("QuietZoneModule", typeof(QuietZoneModules), typeof(QrCodeImgControl),
            new UIPropertyMetadata(QuietZoneModules.Two, new PropertyChangedCallback(OnVisualValueChanged)));

        [Browsable(true), EditorBrowsable(EditorBrowsableState.Always), Category("QrCode")]
        public QuietZoneModules QuietZoneModule
        {
            get { return (QuietZoneModules)GetValue(QuietZoneModuleProperty); }
            set { SetValue(QuietZoneModuleProperty, value); }
        }

        #endregion
后面还有 275 行代码,购买后查看完整代码

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

AI 解读 AI

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

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