/// <summary> /// CONSTRUCTOR /// </summary> /// <param name="PathToOriginal"></param> public ReportImage(string PathToOriginal, ReportImageStateEnum reportsSupported) { this.PathToOriginal = PathToOriginal; this.ImageReportState = reportsSupported; if (filePaths.ContainsKey(PathToOriginal)) { OriginalHash = filePaths[PathToOriginal]; } else { byte[] bytes = File.ReadAllBytes(PathToOriginal); OriginalHash = ImageHasher.Hash(bytes); filePaths.Add(PathToOriginal, OriginalHash); } }
/// <summary> /// Use this if you have an image instead of UserControl /// </summary> /// <param name="image"></param> public ReportImage(string PathToOriginal, Image image, ReportImageStateEnum reportsSupported) : this(PathToOriginal, reportsSupported) { this.ModifiedImage = image; }
/// <summary> /// OVERLOADED CONSTRUCTOR /// </summary> /// <param name="PathToOriginal"></param> /// <param name="control"></param> public ReportImage(string PathToOriginal, System.Windows.Controls.UserControl control, ReportImageStateEnum reportsSupported) : this(PathToOriginal, reportsSupported) { this.ModifiedImage = chartToImage.SaveChartAsImage(control); }