Embedded images
This commit is contained in:
@@ -231,6 +231,7 @@ namespace Volian.Controls.Library
|
||||
myRTB.Clear();
|
||||
//myRTB.LastRtf = string.Empty;
|
||||
myVFG.Clear();
|
||||
myPicBox.Image = null;
|
||||
tvAudits.Nodes.Clear();
|
||||
if (MyItemInfo == null)
|
||||
{
|
||||
@@ -316,6 +317,22 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
break;
|
||||
}
|
||||
// handle figures (images):
|
||||
else if (cai.Type == 20036 || cai.Type == 20037 || cai.Type == 20038 || cai.Type == 20039)
|
||||
{
|
||||
ImageAuditInfoList imail = ImageAuditInfoList.Get(cai.ContentID);
|
||||
foreach (ImageAuditInfo imai in imail)
|
||||
{
|
||||
if (imai.DeleteStatus == 0)
|
||||
{
|
||||
if (contentHistory == null)
|
||||
contentHistory = tvAudits.Nodes.Add("Content Changes");
|
||||
TreeNode tn = contentHistory.Nodes.Add(imai.ToString());
|
||||
tn.Tag = imai;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (cai.DTS != ci.DTS)
|
||||
{
|
||||
if (contentHistory == null)
|
||||
@@ -761,6 +778,19 @@ namespace Volian.Controls.Library
|
||||
myVFG.Clear();
|
||||
}
|
||||
}
|
||||
if (tn.Tag is ImageAuditInfo)
|
||||
{
|
||||
ImageAuditInfo iai = tn.Tag as ImageAuditInfo;
|
||||
if (MessageBox.Show(this, "Do you want to restore this image?", "Confirm Image Restore", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
ContentInfo ci = ContentInfo.RestoreImage(iai);
|
||||
RefreshRequired = true;
|
||||
UpdateHistory();
|
||||
myRTB.Clear();
|
||||
myVFG.Clear();
|
||||
myPicBox.Image = null; // myPicBox is the PictureBox that shows the selected figure
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<string> myRoFst_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
||||
@@ -784,6 +814,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
btnRestore.Enabled = UserInfo.CanEdit(MyUserInfo, MyProcedureInfo.MyDocVersion);//CanRestore();
|
||||
GridAuditInfo gai = tn.Tag as GridAuditInfo;
|
||||
myPicBox.Visible = false;
|
||||
myVFG.Visible = true;
|
||||
myVFG.BringToFront();
|
||||
panel1.Invalidate(new Rectangle(0, 0, myVFG.Width + 4, 4));
|
||||
@@ -798,6 +829,30 @@ namespace Volian.Controls.Library
|
||||
panel1.Visible = true;
|
||||
return;
|
||||
}
|
||||
if (tn.Tag is ImageAuditInfo)
|
||||
{
|
||||
btnRestore.Enabled = UserInfo.CanEdit(MyUserInfo, MyProcedureInfo.MyDocVersion);
|
||||
ImageAuditInfo iai = tn.Tag as ImageAuditInfo;
|
||||
myVFG.Visible = false;
|
||||
myRTB.Visible = false;
|
||||
myPicBox.Visible = true;
|
||||
myPicBox.BringToFront();
|
||||
panel1.Invalidate(new Rectangle(0, 0, myPicBox.Width + 4, 4));
|
||||
panel1.Invalidate(new Rectangle(0, 0, 4, myPicBox.Height + 4));
|
||||
panel1.Visible = false;
|
||||
ImageInfo imgin = ImageInfo.Get(iai.ContentID);
|
||||
|
||||
// check if image data was compressed, i.e. config stores original size:
|
||||
ImageConfig imgCfg = new ImageConfig(imgin);
|
||||
byte[] imgData = iai.Data;
|
||||
if (imgCfg.Image_DataSize > 0) imgData = ROImageInfo.Decompress(imgData, imgCfg.Image_DataSize);
|
||||
MemoryStream ms = new MemoryStream(imgData);
|
||||
myPicBox.Image = System.Drawing.Image.FromStream(ms);
|
||||
myPicBox.Width = Math.Max(myPicBox.Image.Width, panel1.Width);
|
||||
myPicBox.Height = Math.Max(myPicBox.Image.Height, 200);
|
||||
panel1.Visible = true;
|
||||
return;
|
||||
}
|
||||
if (tn.Tag is ContentAuditInfo)
|
||||
{
|
||||
btnRestore.Enabled = UserInfo.CanEdit(MyUserInfo, MyProcedureInfo.MyDocVersion);//CanRestore();
|
||||
|
Reference in New Issue
Block a user