Fix DrawText only showing in Bold
This commit is contained in:
@@ -488,22 +488,22 @@ namespace MarketData.CNNProcessing
|
||||
paint.StrokeWidth = strokeWidth; // Set the desired stroke width
|
||||
paint.Color = color;
|
||||
canvas.DrawLine(txSrcPoint, txDstPoint, paint);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw text on the bitmap
|
||||
/// </summary>
|
||||
/// <param name="color"></param>
|
||||
/// <param name="strokeWidth"></param>
|
||||
/// <param name="srcPoint"></param>
|
||||
/// <param name="dstPoint"></param>
|
||||
public void DrawText(String text, SKPoint srcPoint,SKColor color,SKTextAlign align,SKFont font, float strokeWidth=1)
|
||||
/// <summary>
|
||||
/// Draw text on the bitmap
|
||||
/// </summary>
|
||||
/// <param name="color"></param>
|
||||
/// <param name="strokeWidth"></param>
|
||||
/// <param name="srcPoint"></param>
|
||||
/// <param name="dstPoint"></param>
|
||||
public void DrawText(String text, SKPoint srcPoint, SKColor color, SKTextAlign align, SKFont font,SKPaintStyle paintStyle=SKPaintStyle.Fill,float strokeWidth = 1)
|
||||
{
|
||||
Validate();
|
||||
SKPoint txSrcPoint = pointMapping.MapPoint(srcPoint);
|
||||
using SKCanvas canvas = new SKCanvas(bitmap);
|
||||
using SKPaint paint = new SKPaint();
|
||||
paint.Style = SKPaintStyle.Stroke;
|
||||
paint.Style = paintStyle;
|
||||
paint.StrokeWidth = strokeWidth; // Set the desired stroke width
|
||||
paint.Color = color;
|
||||
canvas.DrawText(text,srcPoint, align, font, paint);
|
||||
|
||||
Reference in New Issue
Block a user