Browse Source

摄像头图片路径

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
3acca7ad4e

+ 19
- 6
Common/system/ImageHelper.cs View File

467
                     break;
467
                     break;
468
             }
468
             }
469
 
469
 
470
-            //克隆位图对象的一部分。
471
-            System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, right - left, bottom - top);
472
-            Bitmap cloneBitmap = bmp.Clone(cloneRect, bmp.PixelFormat);
473
-            bmp.Dispose();
474
-            //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
475
-            return cloneBitmap;
470
+            if(right - left<=0)//zxyceshi
471
+            {
472
+                //克隆位图对象的一部分。
473
+                System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, 1, bottom - top);
474
+                Bitmap cloneBitmap = bmp.Clone(cloneRect, bmp.PixelFormat);
475
+                bmp.Dispose();
476
+                //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
477
+                return cloneBitmap;
478
+            }
479
+            else
480
+            {
481
+                //克隆位图对象的一部分。
482
+                System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, right - left, bottom - top);
483
+                Bitmap cloneBitmap = bmp.Clone(cloneRect, bmp.PixelFormat);
484
+                bmp.Dispose();
485
+                //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
486
+                return cloneBitmap;
487
+            }
488
+         
476
         }
489
         }
477
 
490
 
478
         /// <summary>
491
         /// <summary>

+ 11
- 1
XHWK.WKTool/FileDirectoryWindow.xaml.cs View File

142
                 {
142
                 {
143
                     DAL_Upload dAL_Upload = new DAL_Upload();
143
                     DAL_Upload dAL_Upload = new DAL_Upload();
144
                     string msg = string.Empty;
144
                     string msg = string.Empty;
145
-                    dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid,out msg);
145
+                    bool isOK= dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid,out msg);
146
+                    if(isOK)
147
+                    {
148
+                        pageData.menuList[i].Visi = "Visible";
149
+                        pageData.menuList[i].Coll = "Collapsed";
150
+                    }
151
+                    else
152
+                    {
153
+                        System.Windows.Forms.MessageBox.Show(msg, "", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information, System.Windows.Forms.MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);
154
+                        return;
155
+                    }
146
                 }
156
                 }
147
             }
157
             }
148
         }
158
         }

+ 6
- 4
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

163
                 times.Enabled = true; //启动计时器
163
                 times.Enabled = true; //启动计时器
164
 
164
 
165
                 IsRbnOpen = true;
165
                 IsRbnOpen = true;
166
+
167
+                string imgPath = FileToolsCommon.GetFileAbsolutePath("Temp/imgplayer");
168
+                FileToolsCommon.CreateDirectory(imgPath);
166
             }
169
             }
167
         }
170
         }
168
 
171
 
178
                         if (I > 10010)
181
                         if (I > 10010)
179
                         {
182
                         {
180
                             long time = Timestamp();
183
                             long time = Timestamp();
181
-                        string imgPath= FileToolsCommon.GetFileAbsolutePath("temp/imgplayer");
182
-                            FileToolsCommon.CreateFile(imgPath);
184
+                        string imgPath= FileToolsCommon.GetFileAbsolutePath("Temp/imgplayer");
183
                             //string FilePathName = ImgPath + RsImgName.Count + ".png";
185
                             //string FilePathName = ImgPath + RsImgName.Count + ".png";
184
                             string path = CameraHelper.CaptureImage(imgPath, time.ToString());
186
                             string path = CameraHelper.CaptureImage(imgPath, time.ToString());
185
                             if (!string.IsNullOrWhiteSpace(path))
187
                             if (!string.IsNullOrWhiteSpace(path))
1472
                 APP.pageData.currpage -= 1;
1474
                 APP.pageData.currpage -= 1;
1473
 
1475
 
1474
                 myblackboard.changepage(APP.pageData.currpage - 1);
1476
                 myblackboard.changepage(APP.pageData.currpage - 1);
1475
-                if (APP.PageDrawList.Count > 0)
1477
+                if (APP.pageData.currpage <= APP.PageDrawList.Count)
1476
                 {
1478
                 {
1477
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1479
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1478
                     {
1480
                     {
1539
                 }
1541
                 }
1540
                 APP.pageData.currpage += 1;
1542
                 APP.pageData.currpage += 1;
1541
                 myblackboard.changepage(APP.pageData.currpage - 1);
1543
                 myblackboard.changepage(APP.pageData.currpage - 1);
1542
-                if (APP.PageDrawList.Count > 0)
1544
+                if (APP.pageData.currpage <= APP.PageDrawList.Count)
1543
                 {
1545
                 {
1544
 
1546
 
1545
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1547
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)

Loading…
Cancel
Save