Example #1
0
        public DeviceChangeNotifier()
        {
            InitializeComponent();
            hWPenSign = this.axHWPenSign1;
            hWPenSign.HWSetExtWndHandle(this.Handle.ToInt32());
            var res = hWPenSign.HWInitialize();

            mInstance = this;
        }
Example #2
0
 public static void Stop()
 {
     if (mInstance == null)
     {
         return;
     }
     DeviceNotify = null;
     hWPenSign    = null;
     mInstance.Invoke(new MethodInvoker(mInstance.endForm));
 }
Example #3
0
        private void savepicture(AxHWPenSign axHWPenSign, PictureBox pBoxImg, string OldSign, string NewSign)
        {
            try
            {
                if (pBoxImg.Image == null)
                {
                    if (File.Exists(OldSign))
                    {
                        File.Delete(OldSign);//删除原有的签名
                    }
                    if (File.Exists(NewSign))
                    {
                        File.Delete(NewSign);//删除原有的签名
                    }

                    axHWPenSign.HWSetFilePath(NewSign);//签名
                    long result1 = axHWPenSign.HWSaveFile();
                }
                else
                {
                    if (pBoxImg.Image != null)
                    {
                        pBoxImg.Image.Dispose();
                    }
                    if (NewSign != OldSign)
                    {
                        if (File.Exists(OldSign))
                        {
                            File.Copy(OldSign, NewSign);
                            File.Delete(OldSign);//删除原来的图片
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #4
0
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeviceChangeNotifier));
     this.axHWPenSign1 = new AxHWPenSignLib.AxHWPenSign();
     ((System.ComponentModel.ISupportInitialize)(this.axHWPenSign1)).BeginInit();
     this.SuspendLayout();
     //
     // axHWPenSign1
     //
     this.axHWPenSign1.Enabled  = true;
     this.axHWPenSign1.Location = new System.Drawing.Point(12, 12);
     this.axHWPenSign1.Name     = "axHWPenSign1";
     this.axHWPenSign1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axHWPenSign1.OcxState")));
     this.axHWPenSign1.Size     = new System.Drawing.Size(600, 300);
     this.axHWPenSign1.TabIndex = 0;
     //
     // DeviceChangeNotifier
     //
     this.ClientSize = new System.Drawing.Size(625, 335);
     this.Controls.Add(this.axHWPenSign1);
     this.Name = "DeviceChangeNotifier";
     ((System.ComponentModel.ISupportInitialize)(this.axHWPenSign1)).EndInit();
     this.ResumeLayout(false);
 }