/// <summary>
        /// OnResize we would like to have the largest possible preview
        /// Unfortunately the given dimensions dont match the defined picturebox (480x400) target that much
        /// </summary>
        /// <param name="e"></param>
        protected override void OnResize(EventArgs e)
        {
#if MYDEBUG
            System.Diagnostics.Debug.WriteLine("OnResize: " + this.Width.ToString() + "x" + this.Height.ToString());
#endif
            //#############################################################################
            if (IntermecCamera != null)
            {
#if STREAMING_ON
                addLog("OnResize(): start- we DO NOT SWITCH streaming");
#else
                addLog("OnResize() IntermecCamera.Streaming=false...");
                IntermecCamera.Streaming = false; //dont stream during resize! Do not switch streaming! ALL THE TIME
#endif
                //find the best matching resolution
                Intermec.Multimedia.Camera.Resolution[] _res    = IntermecCamera.AvailableImageResolutions;
                Intermec.Multimedia.Camera.Resolution   _maxRes = _res[0];

                /*
                 * Checking for matching resolution: 486/648
                 * Checking for matching resolution: 972/1296
                 * Checking for matching resolution: 1936/2592
                 * Checking for matching resolution: 120/162
                 * Max resolution is now: 120/162
                 * Checking for matching resolution: 242/324
                 * Max resolution is now: 242/324
                 * Checking for matching resolution: 486/648
                 * Checking for matching resolution: 972/1296
                 * Checking for matching resolution: 1936/2592
                 * or just
                 * Checking for matching resolution: 242/324
                 * Checking for matching resolution: 1936/2592
                 */
                foreach (Intermec.Multimedia.Camera.Resolution r in _res)
                {
                    System.Diagnostics.Debug.WriteLine("Checking for matching resolution: " + r.Width.ToString() + "/" + r.Height.ToString());
                    //if(r.Width == 486)
                    if (r.Width < this.Width && r.Height < this.Height)
                    {
                        _maxRes = r;
                        System.Diagnostics.Debug.WriteLine("Max resolution is now: " + _maxRes.Width.ToString() + "/" + _maxRes.Height.ToString());
                    }
                    //resize Preview pictbox and center it
                    CameraPreview.Width  = _maxRes.Width;
                    CameraPreview.Height = _maxRes.Height;
                    CameraPreview.Left   = (this.Width - CameraPreview.Width) / 2;
                    //resize Snapshot pictbox and center it
                    CameraSnapshot.Width  = _maxRes.Width;
                    CameraSnapshot.Height = _maxRes.Height;
                    //CameraSnapshot.Left = (this.Width - CameraSnapshot.Width) / 2;
                    CameraSnapshot.Location = CameraPreview.Location;
                }
                //initCamera(ref this.CameraPreview);
                //IntermecCamera.PictureBoxUpdate = Camera.PictureBoxUpdateType.None;// Fit;// None;// Fit;// AdjustToFrameSize;
#if STREAMING_ON
                addLog("OnResize(): end- we DO NOT SWITCH streaming");
#else
                addLog("OnResize() IntermecCamera.Streaming=true/false...");
                IntermecCamera.Streaming = bOldStream;    //enable streaming after resize?
#endif
            }
        }
Exemplo n.º 2
0
            public settings()
            {
                viewfinderresolution = Camera.ImageResolutionType.Medium;
                resolution = new Camera.Resolution();
                resolution.BPP = 24;
                resolution.Height = 640;
                resolution.Width = 480;
                resolution.ResolutionID = 10;

                ImprintCaptionPos = Camera.ImprintCaptionPosType.Disabled;
                ImprintCaptionString = "";

                ImprintCompassPosType = Camera.ImprintCompassPosType.Disabled;

                ImprintDateTimePos = Camera.ImprintDateTimePosType.Disabled;

                DisplayCameraInfo = false;
                DisplayHistogram = false;

                _DigitalZoomFactor = 1.00f;
                ImprintInfo = false;
            }
Exemplo n.º 3
0
 public settings(Camera cam, Camera.ImageResolutionType _viewfinderResolution, Camera.Resolution _snapshotResolution)
 {
     _cam = cam;
     viewfinderresolution = _viewfinderResolution;
     resolution = _snapshotResolution;
     readFromCam();
 }
Exemplo n.º 4
0
 public void SetResolution(uint uRes)
 {
     addLog("SetResolution...");
     if (cam == null)
     {
         addLog("SetResolution no cam!");
         return;
     }
     Intermec.Multimedia.Camera.Resolution[] resList = cam.AvailableImageResolutions;
     if (uRes < resList.Length)
         currentRes = resList[uRes];
     addLog("SetResolution done");
 }