Selaa lähdekoodia

摄像头图片路径

tags/录制修改前
zhangxueyang 4 vuotta sitten
vanhempi
commit
3acca7ad4e

+ 19
- 6
Common/system/ImageHelper.cs Näytä tiedosto

@@ -467,12 +467,25 @@ namespace Common.system
467 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 491
         /// <summary>

+ 11
- 1
XHWK.WKTool/FileDirectoryWindow.xaml.cs Näytä tiedosto

@@ -142,7 +142,17 @@ namespace XHWK.WKTool
142 142
                 {
143 143
                     DAL_Upload dAL_Upload = new DAL_Upload();
144 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 Näytä tiedosto

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

Loading…
Peruuta
Tallenna