private void mnuImporteraBilder_Click(object sender, System.EventArgs e) { try { using ( var dlg = new FImport(_aktivFlik,_camera) ) if ( dlg.ShowDialog(this)==DialogResult.OK ) { var images = dlg.SelectedImages; Refresh(); var progress = new frmProgress("Hämtar bilder...",images.Length); progress.Owner = this; progress.Show(); foreach ( FImport.SelectedImage si in images ) { switch ( _aktivFlik.FlikKategori ) { case FlikKategori.Porträtt: case FlikKategori.Vimmel: _aktivFlik.nyttFoto(true, File.ReadAllBytes(si.FileNameJPG), null); break; case FlikKategori.Gruppbild: var fn = Global.GetTempFileName(); si.imgData.saveRAW(fn); _aktivFlik.nyttFoto(true, File.ReadAllBytes(si.FileNameJPG), File.ReadAllBytes(fn)); Util.safeKillFile(fn); break; } progress.increaseValue(); } progress.Close(); progress.Dispose(); } } catch ( Exception ex ) { Global.showMsgBox( this, "mnuImporteraBilder:\r\n{0}", ex.ToString() ); } }
protected override void OnLoad(EventArgs e) { base.OnLoad (e); var r = SystemInformation.WorkingArea; r.Inflate( -r.Width/100, -r.Height/100 ); this.Location = r.Location; this.Size = r.Size; m_progress = new frmProgress("Hämtar nya bilder..."); m_progress.Owner = this; m_progress.Show(); vdUsr.vdOneShotTimer.start( 100, new EventHandler(searchImages), null ); }