|
@@ -53,6 +53,7 @@ public class HTMLView : ReportComponentBase
|
|
Padding = Padding.Empty;
|
|
Padding = Padding.Empty;
|
|
SetFlags(Flags.HasSmartTag, true);
|
|
SetFlags(Flags.HasSmartTag, true);
|
|
CanGrow = true;
|
|
CanGrow = true;
|
|
|
|
+ Width = 10.0f;
|
|
}
|
|
}
|
|
|
|
|
|
public override SmartTagBase GetSmartTag()
|
|
public override SmartTagBase GetSmartTag()
|
|
@@ -103,11 +104,11 @@ public class HTMLView : ReportComponentBase
|
|
{
|
|
{
|
|
if (IsDesigning || !CanGrow)
|
|
if (IsDesigning || !CanGrow)
|
|
return base.CalcHeight();
|
|
return base.CalcHeight();
|
|
- var data = Report.GetColumnValueNullable(DataColumn) as string;
|
|
|
|
|
|
+ var data = Report.GetColumnValueNullable(DataColumn.Replace("[","").Replace("]","")) as string;
|
|
if (String.IsNullOrWhiteSpace(data))
|
|
if (String.IsNullOrWhiteSpace(data))
|
|
return base.CalcHeight();
|
|
return base.CalcHeight();
|
|
- var size = HtmlRender.Measure(data, Width - Padding.Horizontal);
|
|
|
|
- return ((float)size.Height + Padding.Vertical);
|
|
|
|
|
|
+ var size = HtmlRender.Measure(data, (Width - Padding.Horizontal) * 2f);
|
|
|
|
+ return ((float)(size.Height + Padding.Vertical) * 2f);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -119,8 +120,9 @@ public class HTMLView : ReportComponentBase
|
|
{
|
|
{
|
|
render(drawingContext);
|
|
render(drawingContext);
|
|
}
|
|
}
|
|
- RenderTargetBitmap bitmap = new RenderTargetBitmap(
|
|
|
|
- width, height, dpiX, dpiY, PixelFormats.Default);
|
|
|
|
|
|
+
|
|
|
|
+ RenderTargetBitmap bitmap = new RenderTargetBitmap(width * 2, height * 2, dpiX, dpiY, PixelFormats.Pbgra32);
|
|
|
|
+ //width * (int)(dpiX/96.0), height * (int)(dpiY/96.0), 96.0, 96.0, PixelFormats.Pbgra32);
|
|
bitmap.Render(drawingVisual);
|
|
bitmap.Render(drawingVisual);
|
|
|
|
|
|
return bitmap;
|
|
return bitmap;
|
|
@@ -134,10 +136,11 @@ public class HTMLView : ReportComponentBase
|
|
IGraphics g = e.Graphics;
|
|
IGraphics g = e.Graphics;
|
|
|
|
|
|
RectangleF rect = new RectangleF(
|
|
RectangleF rect = new RectangleF(
|
|
- (AbsLeft + Padding.Left) * e.ScaleX,
|
|
|
|
- (AbsTop + Padding.Top) * e.ScaleY,
|
|
|
|
- (Width - Padding.Horizontal) * e.ScaleX,
|
|
|
|
- (Height - Padding.Vertical) * e.ScaleY);
|
|
|
|
|
|
+ AbsLeft + Padding.Left,
|
|
|
|
+ AbsTop + Padding.Top,
|
|
|
|
+ Width - Padding.Horizontal,
|
|
|
|
+ Height - Padding.Vertical
|
|
|
|
+ );
|
|
|
|
|
|
StringFormat format = e.Cache.GetStringFormat(
|
|
StringFormat format = e.Cache.GetStringFormat(
|
|
StringAlignment.Near,
|
|
StringAlignment.Near,
|
|
@@ -169,9 +172,9 @@ public class HTMLView : ReportComponentBase
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(DataColumn))
|
|
if (!string.IsNullOrWhiteSpace(DataColumn))
|
|
{
|
|
{
|
|
- var data = Report.GetColumnValueNullable(DataColumn) as string;
|
|
|
|
- BitmapSource image = CreateBitmap(
|
|
|
|
- (int)(Width * (e.Graphics.DpiX / 96f)) , (int)(Height * e.ScaleX * (e.Graphics.DpiY / 96f)), e.Graphics.DpiX , e.Graphics.DpiY ,
|
|
|
|
|
|
+ var data = Report.GetColumnValueNullable(DataColumn.Replace("[","").Replace("]","")) as string;
|
|
|
|
+ BitmapSource image = CreateBitmap((int)rect.Width, (int)rect.Height, 96f, 96f,
|
|
|
|
+ //(int)(Width * e.ScaleX * (e.Graphics.DpiX / 96f)) , (int)(Height * e.ScaleY * (e.Graphics.DpiY / 96f)), e.Graphics.DpiX , e.Graphics.DpiY ,
|
|
context =>
|
|
context =>
|
|
{
|
|
{
|
|
HtmlRender.Render(context, data,0,0,(int)(Width));
|
|
HtmlRender.Render(context, data,0,0,(int)(Width));
|
|
@@ -179,7 +182,7 @@ public class HTMLView : ReportComponentBase
|
|
|
|
|
|
var bmp = ImageUtils.BitmapSourceToBitmap(image);
|
|
var bmp = ImageUtils.BitmapSourceToBitmap(image);
|
|
bmp.Save("c:\\development\\html.png");
|
|
bmp.Save("c:\\development\\html.png");
|
|
- g.DrawImage(bmp, rect.X, rect.Y, bmp.Width * 96f * e.ScaleX / e.Graphics.DpiX, bmp.Height * 96f * e.ScaleY / e.Graphics.DpiY);
|
|
|
|
|
|
+ g.DrawImage(bmp, rect.X, rect.Y, bmp.Width, bmp.Height);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|