public void ShowOriginalImage() { int index = 0; SearchResultRecord record = SelectedResultRecord; if (record != null) { index = m_ResultSummary.SearchResultList.IndexOf(record); } DetailViewPageInfo.Index = index; // 用using 在Clear的时候m_EditImageForm 为null m_EditImageForm = new EditImageForm(this); m_EditImageForm.FormClosed += new FormClosedEventHandler(EditImageForm_FormClosed); m_EditImageForm.ShowDialog(); }
internal void ShowDetails() { int index = 0; AnalyseRecord record = SelectedAnalyseRecord; if (record != null) { index = m_Records.IndexOf(record); } PageInfo pageInfo = new PageInfo(1, m_Records.Count, index); //DetailViewPageInfo.Index = index; //// 用using 在Clear的时候m_EditImageForm 为null m_EditImageForm = new EditImageForm(m_FileAccess, m_Records, index); m_EditImageForm.FormClosed += new FormClosedEventHandler(EditImageForm_FormClosed); m_EditImageForm.ShowDialog(); }
void EditImageForm_FormClosed(object sender, FormClosedEventArgs e) { m_EditImageForm.Dispose(); m_EditImageForm = null; }
public bool EditImage() { using (System.Drawing.Bitmap myBMP = new System.Drawing.Bitmap(myImage)) { using (EditImageForm dlg = new EditImageForm()) { //if (!string.IsNullOrEmpty(imagecontent)) //{ // if (dlg.LoadImages(imagecontent) == DialogResult.OK) // { // myImage.Dispose(); // myImage = dlg.CurrentImage; // imagecontent = dlg.ImageContent; // myOwnerDocument.Modified = true; // return true; // } //} //else { #region 解决编辑器中图片尺寸和图片编辑窗体中图片不一致的问题 Modified by wwj 2013-04-22 int width = DrectSoft.Library.EmrEditor.Src.Gui.GraphicsUnitConvert.Convert(this.Width, GraphicsUnit.Document, GraphicsUnit.Pixel); int height = DrectSoft.Library.EmrEditor.Src.Gui.GraphicsUnitConvert.Convert(this.Height, GraphicsUnit.Document, GraphicsUnit.Pixel); Image bmpCopy = new Bitmap(width, height); Graphics g = Graphics.FromImage(bmpCopy); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; g.DrawImage(myBMP, 0, 0, bmpCopy.Width, bmpCopy.Height); #endregion if (dlg.LoadImages2(bmpCopy) == DialogResult.OK) { myImage.Dispose(); myImage = dlg.CurrentImage; imagecontent = dlg.ImageContent; #region 解决在图片编辑窗体中修改图片大小后,在编辑器中没有改变的问题 Modified by wwj 2013-04-22 myOwnerDocument.BeginContentChangeLog(); width = DrectSoft.Library.EmrEditor.Src.Gui.GraphicsUnitConvert.Convert(myImage.Width, GraphicsUnit.Pixel, GraphicsUnit.Document); height = DrectSoft.Library.EmrEditor.Src.Gui.GraphicsUnitConvert.Convert(myImage.Height, GraphicsUnit.Pixel, GraphicsUnit.Document); myOwnerDocument.EndContentChangeLog(); myOwnerDocument.RefreshLine(); myOwnerDocument.UpdateView(); #endregion myOwnerDocument.Modified = true; return(true); } } } //using( frmEditImage dlg = new frmEditImage()) //{ // dlg.ShowInTaskbar = false; // dlg.ContentBMP = myBMP ; // dlg.MinimizeBox = false; // dlg.ShowDialog(); // if( dlg.BMPChanged ) // { // myImage.Dispose(); // myImage = dlg.EditedBMP ; // myOwnerDocument.Modified = true; // return true; // } //} } return(false); }