高拍儀拍照SDK開發下載地址:點選下載
本SDK適用於:良田影像S300L|S500L
高拍儀如圖:
SDN開發包安裝之後找到安裝目錄,如圖:
大家找到各自需要的版本即可,需要注意的是如果需要上傳圖片到伺服器的話,我已經寫好了C#版的接收程式,程式碼如下:
<%@ WebHandler Language="C#" Class="FileUpload" %> using System; using System.Web; public class FileUpload : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; HttpPostedFile uploadFile = context.Request.Files[0]; string fileName = System.IO.Path.GetFileName(uploadFile.FileName); int fileSize = uploadFile.ContentLength; string fileExt = System.IO.Path.GetExtension(fileName).ToLower(); string message = ""; if (!(fileExt == ".png" || fileExt == ".gif" || fileExt == ".jpg" || fileExt == ".jpeg")) { message = "圖片型別只能為gif,png,jpg,jpeg"; return; } else { if (fileSize > (int)(500 * 1024)) { message = "圖片大小不能超過500KB"; return; } else { try { string directoryPath = context.Server.MapPath("~/TmpFile/"); if (!System.IO.Directory.Exists(directoryPath))//不存在這個資料夾就建立這個資料夾 { System.IO.Directory.CreateDirectory(context.Server.MapPath("~/TmpFile/")); } uploadFile.SaveAs(context.Server.MapPath("~/TmpFile/") + fileName); message = fileName; } catch (Exception ex) { message = ex.Message; return; } } } } public bool IsReusable { get { return false; } } }
JavaScript呼叫上傳伺服器程式碼:
function SetSelImgs() { var selImgs = ""; // 獲取選中的圖片 for (var i = 0; i < EThumbnails.GetDisplayCount(); i++) { if (1 == EThumbnails.IsChecked(i)) { var fileName = EThumbnails.GetFilePath(i).replace("D:\\", ""); ScanCtrl.UploadFileOfHTTP("http://xxx/FileUpload.ashx", EThumbnails.GetFilePath(i), fileName); selImgs += fileName + ","; } } document.getElementById("selImgs1").value = selImgs; if ("" == selImgs) { alert('請先選中上傳圖片!'); return false; } return true; }
百度雲下載地址:連結:https://pan.baidu.com/s/1wUkJow9Xn2VL2FXMz9itHQ 密碼:nn0v