private void SaveImageFunc()
        {
            while (true)
            {
                Thread.Sleep(2);
                if (isSaveImage)
                {
                    if (imageQueue.Count > 0)
                    {
                        SaveImageInfo saveImageInfo = imageQueue.Dequeue();
                        try
                        {
                            if (useCppKernelSave)
                            {
                                var rect    = new Rectangle(0, 0, saveImageInfo.image.Width, saveImageInfo.image.Height);
                                var bmpData = saveImageInfo.image.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly,
                                                                           saveImageInfo.image.PixelFormat);
                                IntPtr psrcImg = bmpData.Scan0;
                                saveImageInfo.image.UnlockBits(bmpData);

                                if (saveImageInfo.image.PixelFormat == System.Drawing.Imaging.PixelFormat.Format8bppIndexed)
                                {
                                    SaveGreyImage(psrcImg, saveImageInfo.image.Height, saveImageInfo.image.Width, saveImageInfo.fullName);
                                }
                                else if (saveImageInfo.image.PixelFormat == System.Drawing.Imaging.PixelFormat.Format24bppRgb)
                                {
                                    SaveRGB888Image(psrcImg, saveImageInfo.image.Height, saveImageInfo.image.Width, saveImageInfo.fullName);
                                }
                                else if (saveImageInfo.image.PixelFormat == System.Drawing.Imaging.PixelFormat.Format4bppIndexed)
                                {
                                    Save4bppImage(psrcImg, saveImageInfo.image.Height, saveImageInfo.image.Width, saveImageInfo.fullName);
                                }
                                else if (saveImageInfo.image.PixelFormat == System.Drawing.Imaging.PixelFormat.Format16bppRgb565)
                                {
                                    SaveRGB565Image(psrcImg, saveImageInfo.image.Height, saveImageInfo.image.Width, saveImageInfo.fullName);
                                }
                                else
                                {
                                    saveImageInfo.image.Save(saveImageInfo.fullName);
                                }
                            }
                            else
                            {
                                saveImageInfo.image.Save(saveImageInfo.fullName);
                            }
                        }
                        catch (Exception ex)
                        {
                            Notifier.NotifyHelper.Notify(Notifier.NotifyLevel.ERROR,
                                                         $"保存图像出错,错误信息{ex.Message}.");
                        }
                    }
                }
            }
        }
 /// <summary>
 /// 通过保存文件的全名保存图像
 /// </summary>
 /// <param name="image">图像对象</param>
 /// <param name="imagefullName">图像的名称的全名(绝对路径)</param>
 public virtual void SaveImageByFullName(Bitmap image, string imagefullName)
 {
     if (isSaveImage)
     {
         if (imageQueue.Count > 100)
         {
             CommonModules.Notifier.NotifyHelper.Notify(Notifier.NotifyLevel.ERROR,
                                                        "保存图像队列缓存大于100,将自动丢弃当前图像!");
             return;
         }
         //保存图像
         SaveImageInfo saveImageInfo = new SaveImageInfo(image, imagefullName);
         imageQueue.Enqueue(saveImageInfo);
     }
 }
        /// <summary>
        /// 保存图像
        /// </summary>
        /// <param name="image">图像对象</param>
        /// <param name="imgName">图形名称</param>
        public virtual void SaveImage(Bitmap image, string imgName)
        {
            if (isSaveImage)
            {
                if (imageQueue.Count > 100)
                {
                    CommonModules.Notifier.NotifyHelper.Notify(Notifier.NotifyLevel.ERROR,
                                                               "保存图像队列缓存大于100,将自动丢弃当前图像!");
                    return;
                }
                //检查名称合法性
                if (checkNameValidity)
                {
                    if (!CheckImageNameValidity(imgName))
                    {
                        return;
                    }
                }

                string saveFolder = saveRootPath;
                if (autoCreateDateFolder)
                {
                    saveFolder = new StringBuilder(saveRootPath).Append(@"\").Append(DateTime.Now.ToString("yyyy-MM-dd")).ToString();
                    if (!System.IO.Directory.Exists(saveFolder))
                    {
                        System.IO.Directory.CreateDirectory(saveFolder);
                    }
                }
                //生成图像名
                string fullName = MakeImageName(saveFolder, imgName);
                ImageFileName = fullName;
                //保存图像
                SaveImageInfo saveImageInfo = new SaveImageInfo(image, fullName);
                imageQueue.Enqueue(saveImageInfo);
            }
        }