Ejemplo n.º 1
0
        string ISDK.Capture2Image()
        {
            string PictureFileName = Helper.UniqueFile(SaveFileType.Picture, FileExtensionType.bmp);

            SHCFNetSDK.NET_SDK_CapturePicture(realHandle, PictureFileName);
            return(PictureFileName);
        }
Ejemplo n.º 2
0
        string ISDK.Capture2Base64()
        {
            string PictureFileName = Helper.UniqueFile(SaveFileType.Picture, FileExtensionType.bmp);

            if (!SHCFNetSDK.NET_SDK_CapturePicture(realHandle, PictureFileName))
            {
                throw new Exception("[上海诚丰]截图失败:" + GetErrorMessage());
            }

            Bitmap bmp = new Bitmap(PictureFileName);

            using (MemoryStream ms1 = new MemoryStream())
            {
                bmp.Save(ms1, System.Drawing.Imaging.ImageFormat.Jpeg);
                byte[] arr1 = new byte[ms1.Length];
                ms1.Position = 0;
                ms1.Read(arr1, 0, (int)ms1.Length);
                ms1.Close();
                return(Convert.ToBase64String(arr1));
            }
        }