Beispiel #1
0
 public override void OnInspectorGUI()
 {
     if (Application.isPlaying)
     {
         if (GUILayout.Button("Capture"))
         {
             CaptureUtility utility = target as CaptureUtility;
             utility.Capture(utility.GetUniqueCaptureName());
         }
     }
     else
     {
         GUILayout.Label("Run application to capture screenshots.");
     }
 }
 public M280(string commPort = "")
 {
     readerdata = string.Empty;
     commport   = commPort;
     dlfile     = new DLFILE();
     dispatcher = Dispatcher.CurrentDispatcher;
     dispatcher.Thread.Priority = ThreadPriority.Highest;
     captureutility             = new CaptureUtility();
     Initialized           = null;
     Captured              = null;
     DeviceAttached        = null;
     DeviceDetached        = null;
     ReceiveData           = null;
     handleException       = Thread_Exception;
     imageview             = Image_Captured;
     checkstatus           = new System.Timers.Timer();
     checkstatus.AutoReset = false;
     checkstatus.Elapsed  += CheckState_Tick;
     checkstatus.Interval  = M280DEF.StatusGetInterval;
     capture           = new System.Timers.Timer();
     capture.AutoReset = false;
     capture.Elapsed  += Capture_Tick;
     capture.Interval  = 500;
     bulkendpoint      = null;
     controlendpoint   = null;
     deviceready       = false;
     release           = true;
     running           = false;
     scannerconnected  = false;
     devicebusy        = true;
     deskew            = true;
     m280status        = new byte[M280DEF.STATUS_SIZE];
     pixelformat       = PixelFormat.Format16bppRgb565;
     totalpixelsize    = 0;
     InitializePixelSize();
     buffernum     = totalpixelsize / (512 * M280DEF.Packet_Xfer);
     buffersize    = 0;
     queuesize     = 0;
     successes     = 0;
     failures      = 0;
     transferbytes = 0;
     disposed      = false;
     GetUsbDevices();
     InitializeScanner();
     InitializeReader();
     onInitialized();
 }
Beispiel #3
0
 /// <summary>
 /// Captures the specified area of the control or whats underneath
 /// the control. If the argument flag client is true, only the client
 /// area of the control is captured, otherwise the entire control is
 /// captured. If the argument flag under is true, the capture area under
 /// the control is captured, otherwise the specified area on the control
 /// is captured.
 /// </summary>
 /// <returns>bitmap image of the control or whats underneath the control</returns>
 public Bitmap Capture()
 {
     return(CaptureUtility.Capture(this));
 }