|
|
|
@ -78,7 +78,7 @@ namespace ICSharpCode.Reports.Addin
@@ -78,7 +78,7 @@ namespace ICSharpCode.Reports.Addin
|
|
|
|
|
public string ImageFileName { |
|
|
|
|
get { return imageFileName; } |
|
|
|
|
set { imageFileName = value; |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.BaseImage > {0}",this.ImageFileName)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.Set BaseImage > {0}",this.ImageFileName)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -96,23 +96,14 @@ namespace ICSharpCode.Reports.Addin
@@ -96,23 +96,14 @@ namespace ICSharpCode.Reports.Addin
|
|
|
|
|
return b; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Image LoadImage () |
|
|
|
|
{ |
|
|
|
|
try { |
|
|
|
|
Image im = null; |
|
|
|
|
// string absFileName = this.AbsoluteFileName;
|
|
|
|
|
|
|
|
|
|
this.relativeFileName = FileUtility.GetRelativePath(this.ReportFileName,this.ImageFileName); |
|
|
|
|
// absFileName = FileUtility.GetAbsolutePath (this.relativeFileName,this.ImageFileName);
|
|
|
|
|
// System.Diagnostics.Trace.WriteLine("-----");
|
|
|
|
|
// System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage ReportFN > {0}",this.reportFileName));
|
|
|
|
|
// System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage IamgeFN > {0}",this.ImageFileName));
|
|
|
|
|
// System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage rel neu s3 > {0}",this.relativeFileName));
|
|
|
|
|
// System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage from absolute > {0}",this.AbsoluteFileName));
|
|
|
|
|
// System.Diagnostics.Trace.WriteLine("-----");
|
|
|
|
|
string absFileName = this.AbsoluteFileName; |
|
|
|
|
if (!String.IsNullOrEmpty(absFileName) && File.Exists(absFileName)){ |
|
|
|
|
im = Image.FromFile (absFileName); |
|
|
|
|
Image im; |
|
|
|
|
string absFileName = this.AbsoluteFileName; |
|
|
|
|
if (!String.IsNullOrEmpty(absFileName) && File.Exists(absFileName)) { |
|
|
|
|
im = Image.FromFile (this.AbsoluteFileName); |
|
|
|
|
} else { |
|
|
|
|
im = BaseImageItem.ErrorBitmap(base.Size); |
|
|
|
|
} |
|
|
|
@ -122,7 +113,6 @@ string absFileName = this.AbsoluteFileName;
@@ -122,7 +113,6 @@ string absFileName = this.AbsoluteFileName;
|
|
|
|
|
throw new ReportException(str); |
|
|
|
|
} |
|
|
|
|
return im; |
|
|
|
|
|
|
|
|
|
} catch (System.OutOfMemoryException) { |
|
|
|
|
throw; |
|
|
|
|
} catch (System.IO.FileNotFoundException) { |
|
|
|
@ -131,27 +121,24 @@ string absFileName = this.AbsoluteFileName;
@@ -131,27 +121,24 @@ string absFileName = this.AbsoluteFileName;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Image old_LoadImage () |
|
|
|
|
{ |
|
|
|
|
try { |
|
|
|
|
Image im = null; |
|
|
|
|
string absFileName = this.AbsoluteFileName; |
|
|
|
|
System.Diagnostics.Trace.WriteLine("-----"); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage > {0}",absFileName)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage ReportFN > {0}",this.reportFileName)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage IamgeFN > {0}",this.ImageFileName)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage IamgeFN > {0}",this.RelativeFileName)); |
|
|
|
|
// string s1 = FileUtility.GetRelativePath(this.reportFileName,this.ImageFileName);
|
|
|
|
|
|
|
|
|
|
string s2 = FileUtility.GetRelativePath(this.ImageFileName,this.ReportFileName); |
|
|
|
|
string s3 = FileUtility.GetAbsolutePath (s2,this.ImageFileName); |
|
|
|
|
// System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage s1 > {0}",s1));
|
|
|
|
|
//System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage s2 > {0}",s2));
|
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.LoadImage from absolute s3 > {0}",s3)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine("-----"); |
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(relativeFileName)) { |
|
|
|
|
string testFileName = FileUtility.NormalizePath(Path.Combine(Path.GetDirectoryName(this.reportFileName),this.relativeFileName)); |
|
|
|
|
if (File.Exists(testFileName)){ |
|
|
|
|
System.Diagnostics.Trace.WriteLine("Found"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.relativeFileName = FileUtility.GetRelativePath(this.ReportFileName,this.ImageFileName); |
|
|
|
|
string absFileName = this.AbsoluteFileName; |
|
|
|
|
if (!String.IsNullOrEmpty(absFileName) && File.Exists(absFileName)){ |
|
|
|
|
im = Image.FromFile (this.AbsoluteFileName); |
|
|
|
|
im = Image.FromFile (absFileName); |
|
|
|
|
} else { |
|
|
|
|
im = BaseImageItem.ErrorBitmap(base.Size); |
|
|
|
|
} |
|
|
|
@ -170,6 +157,7 @@ string absFileName = this.AbsoluteFileName;
@@ -170,6 +157,7 @@ string absFileName = this.AbsoluteFileName;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnoreAttribute] |
|
|
|
|
public Image Image { |
|
|
|
|
get { |
|
|
|
@ -226,12 +214,11 @@ string absFileName = this.AbsoluteFileName;
@@ -226,12 +214,11 @@ string absFileName = this.AbsoluteFileName;
|
|
|
|
|
|
|
|
|
|
[XmlIgnoreAttribute] |
|
|
|
|
[Category("Image")] |
|
|
|
|
// [Browsable(false)]
|
|
|
|
|
public string ReportFileName { |
|
|
|
|
get { return Path.GetFullPath(reportFileName); } |
|
|
|
|
set { reportFileName = value; |
|
|
|
|
System.Diagnostics.Trace.WriteLine(""); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.ImageItem> Filename {0}",Path.GetFullPath(this.reportFileName)));} |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("<ADDIN.ImageItem>ReportFileName {0}",Path.GetFullPath(this.reportFileName)));} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -246,16 +233,22 @@ string absFileName = this.AbsoluteFileName;
@@ -246,16 +233,22 @@ string absFileName = this.AbsoluteFileName;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// [XmlIgnoreAttribute]
|
|
|
|
|
[XmlIgnoreAttribute] |
|
|
|
|
// [Category("Image")]
|
|
|
|
|
// [Browsable(false)]
|
|
|
|
|
public string AbsoluteFileName |
|
|
|
|
{ |
|
|
|
|
get { |
|
|
|
|
|
|
|
|
|
string absolute = FileUtility.GetAbsolutePath(reportFileName,imageFileName); |
|
|
|
|
|
|
|
|
|
if (File.Exists(absolute)){ |
|
|
|
|
System.Diagnostics.Trace.WriteLine("Image.AbsoluteFileName"); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("Load from {0}",absolute)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("report {0}",this.reportFileName)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("img ab {0}",this.ImageFileName)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("im rel {0}",this.relativeFileName)); |
|
|
|
|
string t = FileUtility.NormalizePath(Path.Combine(Path.GetDirectoryName(this.reportFileName),this.relativeFileName)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine(String.Format("rebuild {0}",t)); |
|
|
|
|
System.Diagnostics.Trace.WriteLine("---------"); |
|
|
|
|
return absolute; |
|
|
|
|
} |
|
|
|
|
if (!string.IsNullOrEmpty(relativeFileName)) { |
|
|
|
|