Пример #1
0
        public static DialogResult showDialog(
            Form parent,
            baseFlikForm aktivFlik,
            vdCamera.vdCamera camera)
        {
            using (var dlg = new FImporteraBildfiler())
            {
                dlg._aktivFlik = aktivFlik;
                dlg._requireRaw = eosPresets.UsesRaw( aktivFlik.PresetType, camera );
                var sz = aktivFlik.FlikKategori == FlikKategori.Porträtt
                                  ? new Size(120, 180)
                                  : new Size(180, 120);
               dlg._thumbnails = new Thumbnails(null, Global.Skola, sz.Width, sz.Height, 10);

                if (dlg.ShowDialog(parent) != DialogResult.OK)
                    return DialogResult.Cancel;

                Global.Preferences.LastImportFolder = dlg._strPath;
                Global.sparaInställningar();

                var images = dlg.SelectedImages.ToArray();
                var progress = new frmProgress("Hämtar bilder...", images.Length);
                progress.Owner = parent;
                progress.Show();
                try
                {
                    foreach (var filename in images)
                    {
                        byte[] rawData = null;
                        foreach (var ext in new[] {".raw", ".cr2", ".tif"})
                        {
                            var rawFile = Path.ChangeExtension(filename, ext);
                            if (File.Exists(rawFile))
                                rawData = File.ReadAllBytes(rawFile);
                        }
                        aktivFlik.nyttFoto(
                            true,
                            File.ReadAllBytes(filename),
                            rawData);

                        progress.increaseValue();
                    }
                    return DialogResult.OK;
                }
                catch (Exception ex)
                {
                    Global.showMsgBox(null, "mnuImporteraBildfiler:\r\n{0}", ex.ToString());
                }
                finally
                {
                    progress.Close();
                }

                return DialogResult.Cancel;
            }
        }
Пример #2
0
        public FImport(baseFlikForm AktivFlik, vdCamera.vdCamera camera)
        {
            m_AktivFlik = AktivFlik;
            _camera = camera;

            InitializeComponent();

            _thumbnails = m_AktivFlik.FlikKategori==FlikKategori.Porträtt
                ? new PlataDM.Thumbnails( null, Global.Skola, 120, 160, 10 )
                : new PlataDM.Thumbnails( null, Global.Skola, 160, 120, 10 );

            vsb.ValueChanged +=vsb_ValueChanged;
        }
Пример #3
0
        public FCameraSettings(vdCamera.vdCamera camera)
        {
            InitializeComponent();

            _camera = camera;
            _cameraType = _camera.CameraType;
            //if (_cameraType != vdCamera.CameraType.EOS_5D_MarkII && _cameraType != vdCamera.CameraType.EOS_5D && _cameraType != vdCamera.CameraType.EOS_1Ds_MarkII)
            //	throw new Exception();

            optNoChange.CheckedChanged += opt_CheckedChanged;
            optGroupIn.CheckedChanged += opt_CheckedChanged;
            optGroupOut.CheckedChanged += opt_CheckedChanged;
            optPortraitIn.CheckedChanged += opt_CheckedChanged;
            optPortraitOut.CheckedChanged += opt_CheckedChanged;
            optVimmel.CheckedChanged += opt_CheckedChanged;
            optFree.CheckedChanged += opt_CheckedChanged;
        }
Пример #4
0
            public void Apply(vdCamera.vdCamera camera)
            {
                if ( !camera.IsConnected )
                    return;

                camera.BatchBeginSet();
                if ( Mode != 0xffff )
                    camera.SetShootingMode( Mode );
                if ( TV != 0xffff )
                    camera.SetTvValue( TV );
                if ( AV != 0xffff )
                    camera.SetAvValue( AV );
                if ( ISO != 0xffff )
                    camera.SetISONumber( ISO );
                if ( WB != 0xffff )
                    camera.SetWhiteBalance( WB, Kelvin  );
                if ( ColorMatrix != 0xffff )
                    camera.SetColorMatrix( ColorMatrix );
                camera.SetParameterSharpnessContrast( ParameterSet, Sharpness, Contrast, Saturation, ColorTone );
                camera.SetImageFormatAttribute(ImageTypeSize);
                camera.BatchEnd();
            }
Пример #5
0
 public static Preset GetCurrentCameraSettings( vdCamera.vdCamera camera )
 {
     int nP, nS1, nC1, nS2, nC2, whiteBalance, kelvin;
     camera.GetParameterSharpnessContrast( out nP, out nS1, out nC1, out nS2, out nC2 );
     camera.GetWhiteBalance(out whiteBalance, out kelvin);
     return new Preset(
         camera.GetTvValue(),
         camera.GetAvValue(),
         camera.GetISONumber(),
         whiteBalance,
         camera.GetShootingMode(),
         nP,
         nS1,
         nC1,
         nS2,
         nC2,
         camera.GetColorMatrix(),
         0xffff,
         kelvin,
         camera.GetImageFormatAttribute() );
 }
Пример #6
0
 public static bool UsesRaw(PresetType pt, vdCamera.vdCamera camera)
 {
     var preset = GetPreset(pt, camera.CameraType);
     return preset != null && preset.ImageTypeSize.StartsWith("raw",StringComparison.OrdinalIgnoreCase);
 }
Пример #7
0
 public static void ApplyPreset(PresetType pt, vdCamera.vdCamera camera)
 {
     var preset = GetPreset(pt,camera.CameraType);
     if ( preset != null )
         preset.Apply( camera );
 }
Пример #8
0
 private static eosPresets.Preset getDefaultSettings( eosPresets.PresetType pt, vdCamera.CameraType cameraType )
 {
     if ( s_hashDefaultSettings.ContainsKey(pt) )
         return (eosPresets.Preset)s_hashDefaultSettings[pt];
     return eosPresets.GetPreset( pt, cameraType );
 }
Пример #9
0
        private static string[] cameraSettingsToText( vdCamera.vdCamera camera, eosPresets.Preset preset )
        {
            var result = new string[9];

            var tr = camera.Translation;
            result[0] = tr.ShutterSpeed.Text(preset.TV, string.Empty);
            result[1] = tr.Aperture.Text(preset.AV, string.Empty);
            result[2] = tr.ISO.Text(preset.ISO);
            result[3] = tr.WhiteBalance.Text(preset.WB);
            result[4] = preset.KelvinText;
            result[5] = tr.ShootingMode.Text(preset.Mode);
            result[6] = string.Format("{0}/{1}/{2}/{3}/{4}", tr.Parameters.Text(preset.ParameterSet), preset.SharpnessText, preset.ContrastText, preset.SaturationText, preset.ColorToneText);
            result[7] = tr.ColorMatrix.Text(preset.ColorMatrix);
            result[8] = preset.ImageTypeSize;
            return result;
        }