Free up memory after creating an image that is printed on the report (used for image RO’s and X/Y Plots)

This commit is contained in:
John Jenko 2015-05-04 19:08:17 +00:00
parent 3fe7f68166
commit 5a27f169d5

View File

@ -315,6 +315,7 @@ namespace Volian.Print.Library
datatable.AddCell(cell2); datatable.AddCell(cell2);
GenerateErrorMessage(ex2, "Bad Image File. ", string.Format("Image File: {0}", filename)); GenerateErrorMessage(ex2, "Bad Image File. ", string.Format("Image File: {0}", filename));
//_MyErrorBookMarks.Add(filename, pdfDest); //_MyErrorBookMarks.Add(filename, pdfDest);
roImage.Dispose();
return; return;
} }
} }
@ -322,6 +323,7 @@ namespace Volian.Print.Library
PdfPCell cell = new PdfPCell(it_image); PdfPCell cell = new PdfPCell(it_image);
cell.BorderColor = Color.WHITE; cell.BorderColor = Color.WHITE;
datatable.AddCell(cell); datatable.AddCell(cell);
roImage.Dispose();
} }
else else
{ {
@ -329,6 +331,7 @@ namespace Volian.Print.Library
messageCell.BorderColor = Color.WHITE; messageCell.BorderColor = Color.WHITE;
datatable.AddCell(messageCell); datatable.AddCell(messageCell);
GenerateErrorMessage(null, "Image File Missing. ", string.Format("Image File: {0}", filename)); GenerateErrorMessage(null, "Image File Missing. ", string.Format("Image File: {0}", filename));
Application.DoEvents();
//_MyErrorBookMarks.Add(filename, pdfDest); //_MyErrorBookMarks.Add(filename, pdfDest);
} }
} }
@ -393,12 +396,15 @@ namespace Volian.Print.Library
break; break;
case 100: // Text Field - sometimes also XY Plot case 100: // Text Field - sometimes also XY Plot
Text(); Text();
Application.DoEvents();
break; break;
case 101: // Plot Field case 101: // Plot Field
XYPlot(); XYPlot();
Application.DoEvents();
break; break;
case 102: // Image Field case 102: // Image Field
ImageFile(); ImageFile();
Application.DoEvents();
break; break;
case 103: // Multi Begin - Display data for setpoints case 103: // Multi Begin - Display data for setpoints
Multiple(); Multiple();