示例#1
0
        private void SDK_ImageDownloaded(Bitmap bitmap, ImageType imageType)
        {
            if (PictureTaken != null)
            {
                short number = currentImageNumber;

                PictureTakenEventArgs eventArgs = new PictureTakenEventArgs()
                {
                    Image            = bitmap,
                    StartImageNumber = startImageNumber,
                    Number           = number,
                    GroupNumber      = groupNumber,
                    ColorMode        = colorMode
                };

                PictureTaken(eventArgs);
            }

            /*
             * if (CameraHandler != null)
             * {
             *  CameraHandler.Dispose();
             *  CameraHandler = null;
             * }
             */
        }
        private void SDK_ImageDownloaded(Bitmap bitmap, ImageType imageType)
        {
            if (PictureTaken != null)
            {
                short number = 0;

                if (seriesType == TakePhotoSeriesTypeEnum.ImageSeries)
                {
                    number = currentImageNumber;
                }
                if (seriesType == TakePhotoSeriesTypeEnum.PhaseShifts)
                {
                    number = currentPhaseShiftNumber;
                }

                if (!is256Frames)
                {
                    PictureTakenEventArgs eventArgs = new PictureTakenEventArgs()
                    {
                        Image            = bitmap,
                        StartImageNumber = startImageNumber,
                        Number           = number,
                        GroupNumber      = groupNumber,
                        PhaseShiftValue  = Convert.ToInt16(currentPhaseShiftValue),
                        ColorMode        = colorMode
                    };

                    PictureTaken(eventArgs);
                }
                else
                {
                    //Save bitmap
                    string fileName = string.Format("{0}.jpg", currentImageNumber.ToString());
                    string filePath = Path.Combine(frames256Directory, fileName);

                    Bitmap image = new Bitmap(bitmap);
                    image.Save(filePath);
                }
            }

            TryTakeNextPhoto();
        }