Output.Printers.OnePerMeter can print water meter images.

This commit is contained in:
Milan Hanajik
2017-12-06 14:57:56 +03:00
parent 6b6098164a
commit f6e44914fa
6 changed files with 224 additions and 30 deletions
@@ -148,18 +148,25 @@ namespace Results.Output.Printers.OnePerMeter
if (pageNr == 1)
{
///
/// Print water meter picture
///
if (cfg.ImgWid != 0 && cfg.ImgHgh != 0 && cfg.ImgFullPathName != null)
{
try
{
e.Graphics.DrawImage(new Bitmap(Image.FromFile(cfg.ImgFullPathName), cfg.ImgWid, cfg.ImgHgh),
new Rectangle(cfg.ImgLeft, cfg.ImgTop, cfg.ImgWid, cfg.ImgHgh));
}
catch (Exception) { } /// Cope with situations when file is missing or is not correct
}
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
commonTop = TitleY + titleHeight + spacingOne4Header;
commonHeight = commonItems.Count * spacingOne;
bodyTop = commonTop + commonHeight + spacingOne4Header;
}
/// Use the StringFormat class for the text layout of our document
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
if (pageNr == 1)
{
///
/// Title
///
@@ -33,5 +33,10 @@ namespace Results.Output.Printers.OnePerMeter
public string Footer;
public bool TestsAreRows;
public bool TestsAreRows2;
public string ImgFullPathName;
public int ImgLeft;
public int ImgTop;
public int ImgWid;
public int ImgHgh;
}
}