|
|
|
|
@ -9,20 +9,15 @@
@@ -9,20 +9,15 @@
|
|
|
|
|
using System; |
|
|
|
|
using System.Drawing; |
|
|
|
|
using System.Drawing.Text; |
|
|
|
|
using System.Windows; |
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.Reporting.BaseClasses |
|
|
|
|
{ |
|
|
|
|
/// <summary>
|
|
|
|
|
/// Description of TextDrawer.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class TextDrawer |
|
|
|
|
public static class TextDrawer |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
private TextDrawer() |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void DrawString(Graphics graphics,string text, |
|
|
|
|
Font font,Brush brush, |
|
|
|
|
RectangleF rectangle, |
|
|
|
|
@ -40,39 +35,38 @@ namespace ICSharpCode.Reporting.BaseClasses
@@ -40,39 +35,38 @@ namespace ICSharpCode.Reporting.BaseClasses
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void DrawString (Graphics graphics,string text) |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
if (graphics == null) { |
|
|
|
|
throw new ArgumentNullException("graphics"); |
|
|
|
|
public static StringFormat BuildStringFormat(StringTrimming stringTrimming,TextAlignment alignment){ |
|
|
|
|
StringFormat format = StringFormat.GenericTypographic; |
|
|
|
|
format.Trimming = stringTrimming; |
|
|
|
|
format.FormatFlags = StringFormatFlags.LineLimit; |
|
|
|
|
switch (alignment) { |
|
|
|
|
case TextAlignment.Left:{ |
|
|
|
|
format.Alignment = StringAlignment.Near; |
|
|
|
|
format.LineAlignment = StringAlignment.Near; |
|
|
|
|
return format; |
|
|
|
|
} |
|
|
|
|
case TextAlignment.Center:{ |
|
|
|
|
format.Alignment = StringAlignment.Center; |
|
|
|
|
format.LineAlignment = StringAlignment.Near; |
|
|
|
|
return format; |
|
|
|
|
} |
|
|
|
|
// if (decorator == null) {
|
|
|
|
|
// throw new ArgumentNullException("decorator");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// StringFormat stringFormat = BuildStringFormat(decorator.StringTrimming,decorator.ContentAlignment);
|
|
|
|
|
//
|
|
|
|
|
// if (decorator.RightToLeft ==System.Windows.Forms.RightToLeft.Yes) {
|
|
|
|
|
// stringFormat.FormatFlags = stringFormat.FormatFlags | StringFormatFlags.DirectionRightToLeft;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
var formattedString = text; |
|
|
|
|
// if (! String.IsNullOrEmpty(decorator.FormatString)) {
|
|
|
|
|
// formattedString = StandardFormatter.FormatOutput(text,decorator.FormatString,decorator.DataType,String.Empty);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
graphics.TextRenderingHint = TextRenderingHint.AntiAlias; |
|
|
|
|
|
|
|
|
|
// graphics.DrawString (formattedString,decorator.Font,
|
|
|
|
|
// new SolidBrush(decorator.ForeColor),
|
|
|
|
|
// new Rectangle(decorator.Location.X,
|
|
|
|
|
// decorator.Location.Y,
|
|
|
|
|
// decorator.Size.Width,
|
|
|
|
|
// decorator.Size.Height),
|
|
|
|
|
// stringFormat);
|
|
|
|
|
case TextAlignment.Right:{ |
|
|
|
|
format.Alignment = StringAlignment.Far; |
|
|
|
|
format.LineAlignment = StringAlignment.Near; |
|
|
|
|
return format; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case TextAlignment.Justify:{ |
|
|
|
|
format.Alignment = StringAlignment.Center; |
|
|
|
|
format.LineAlignment = StringAlignment.Near; |
|
|
|
|
return format; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return format; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
public static StringFormat BuildStringFormat(StringTrimming stringTrimming,ContentAlignment alignment) |
|
|
|
|
{ |
|
|
|
|
StringFormat format = StringFormat.GenericTypographic; |
|
|
|
|
@ -139,5 +133,6 @@ namespace ICSharpCode.Reporting.BaseClasses
@@ -139,5 +133,6 @@ namespace ICSharpCode.Reporting.BaseClasses
|
|
|
|
|
format.LineAlignment = StringAlignment.Far; |
|
|
|
|
return format; |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|