18 changed files with 236 additions and 84 deletions
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 21.06.2015 |
||||
* Time: 17:01 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using ICSharpCode.Reporting.PageBuilder.ExportColumns; |
||||
|
||||
namespace ICSharpCode.Reporting.Items |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ExportExtension.
|
||||
/// </summary>
|
||||
public static class ExportExtension |
||||
{ |
||||
public static void ToExportItem (this ExportColumn export, PrintableItem item) { |
||||
export.Name = item.Name; |
||||
export.Location = item.Location; |
||||
export.Size = item.Size; |
||||
export.ForeColor = item.ForeColor; |
||||
export.FrameColor = item.FrameColor; |
||||
export.BackColor = item.BackColor; |
||||
export.CanGrow = item.CanGrow; |
||||
export.DrawBorder = item.DrawBorder; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 21.06.2015 |
||||
* Time: 11:54 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Reporting.Interfaces.Export; |
||||
using ICSharpCode.Reporting.PageBuilder.ExportColumns; |
||||
|
||||
namespace ICSharpCode.Reporting.Items |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseImageItem.
|
||||
/// </summary>
|
||||
public class BaseImageItem:PrintableItem |
||||
{ |
||||
Image image; |
||||
|
||||
public BaseImageItem() |
||||
{ |
||||
} |
||||
|
||||
#region IExportColumnBuilder implementation
|
||||
|
||||
public override IExportColumn CreateExportColumn(){ |
||||
var export = new ExportImage(); |
||||
export.ToExportItem(this); |
||||
|
||||
export.Image = Image; |
||||
export.ScaleImageToSize = ScaleImageToSize; |
||||
return export; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
static Bitmap FakeImage(Size size, string text){ |
||||
|
||||
var b = new Bitmap (size.Width,size.Height); |
||||
using (Graphics g = Graphics.FromImage (b)){ |
||||
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; |
||||
g.DrawRectangle (new Pen(Color.Black, 1), |
||||
1,1,size.Width -2,size.Height -2); |
||||
|
||||
g.DrawString(text,new Font("Microsoft Sans Serif", |
||||
16, |
||||
FontStyle.Regular, |
||||
GraphicsUnit.Point), |
||||
new SolidBrush(Color.Gray), |
||||
new RectangleF(2,2,size.Width,size.Height) ); |
||||
} |
||||
return b; |
||||
} |
||||
|
||||
|
||||
public Image Image { |
||||
get { |
||||
string text = "<Dummy Design Image>"; |
||||
this.image = FakeImage(Size, text); |
||||
return this.image; |
||||
} |
||||
|
||||
set { |
||||
this.image = value; |
||||
} |
||||
} |
||||
|
||||
public bool ScaleImageToSize {get;set;} |
||||
} |
||||
} |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 21.06.2015 |
||||
* Time: 11:57 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Reporting.Exporter.Visitors; |
||||
|
||||
namespace ICSharpCode.Reporting.PageBuilder.ExportColumns |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ExportImage.
|
||||
/// </summary>
|
||||
public class ExportImage:ExportColumn,IAcceptor |
||||
{ |
||||
public ExportImage() |
||||
{ |
||||
} |
||||
|
||||
#region IAcceptor implementation
|
||||
public void Accept(IVisitor visitor){ |
||||
visitor.Visit(this); |
||||
} |
||||
#endregion
|
||||
|
||||
public Image Image {get;set;} |
||||
|
||||
public bool ScaleImageToSize {get;set;} |
||||
} |
||||
} |
Loading…
Reference in new issue