private void MainViewModel_AddPictureStarted(object sender, PictureEventArgs e) { try { // egy dialógusablakban bekérjük a fájlnevet OpenFileDialog dialog = new OpenFileDialog(); dialog.CheckFileExists = true; dialog.Filter = "Képfájlok|*.jpg;*.jpeg;*.bmp;*.tif;*.gif;*.png;"; dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); Boolean?result = dialog.ShowDialog(); if (result == true) { // kép létrehozása (a megfelelő méretekkel) var test = new PictureDTO { ArticleId = e.ArticleId, Image = PictureHandler.OpenAndResize(dialog.FileName, 100) }; //_service.AddImageAsync(test); _mainViewModel.Pictures.Add(test); _editorView.DataContext = _mainViewModel; _editorView.Show(); } } catch { } }
void mdxrReader_Obrazek(object sender, PictureEventArgs ev) { VypsatTagProAktualniZnakovyStyl(); if (mtreaAktualniTextRun != null) { mtreaAktualniTextRun.Text = String.Empty; } mxwWriter.WriteStartElement(obrazekElementName); mxwWriter.WriteAttributeString("id", ev.Identifikator); mxwWriter.WriteAttributeString("n", ev.Sequence.ToString(CultureInfo.InvariantCulture)); mxwWriter.WriteAttributeString("soubor", ev.Umisteni); mxwWriter.WriteEndElement(); //obrazek }
void Thumbnails_OnPictureEvent(object _sender, PictureEventArgs _e) { switch (_e.Type) { case PictureEventArgs.PictureEventType_t.PictureEventType_Selected: { m_SelectedPicture = _e.Picture; // Show Picture view if (tabControlPictureView.SelectedIndex != -1) { m_ScreenPictureViews[tabControlPictureView.SelectedIndex].ShowPicture(_e.Picture); } // Show Info if (m_ScreenPictureInfo == null) { m_ScreenPictureInfo = new ScreenPictureInfo(); ScreenBase.AddToTabControl(m_ScreenPictureInfo, tabControlInfo); } m_ScreenPictureInfo.ShowPicture(_e.Picture); // Show headers if (m_ScreenHeaders == null) { if (m_Engine.Decoder.FileInput.EncodingType == EncodingType.H264) { m_ScreenHeaders = new ScreenHeader[Utils.GetMaxEnumValue <H264HeaderEltType_t>()]; } else { Debug.Assert(false); } } break; } } }
protected virtual void OnPictureChanged(PictureEventArgs e) { PictureChanged?.Invoke(this, e); }
private void ViewerOnPictureChanged(object sender, PictureEventArgs eventArgs) { _dispatcher.BeginInvoke(new Action(() => { ImageLocation = eventArgs.Picture.Fullpath; })); }