You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SKCanvas.DrawText cannot write over a SKBitmap in Azure App Service application for Windows but works in the similar application for Azure App Service on Linux. There is no error or exception, it just does not have any effect.
This is a regression because it was working well in 2.88.9 .
Code
SKBitmap skBitmap = SKBitmap.FromImage(skImage);
SKCanvas skCanvas = new SKCanvas(skBitmap);
SKFont skFont = new SKFont(SKTypeface.Default, 16);
SKPaint sKPaint = new SKPaint(skFont);
sKPaint.Color = new SKColor(255, 0, 0);
sKPaint.IsAntialias = true;
skCanvas.DrawText("My Text", 10, 10, sKPaint);
Expected Behavior
A text is written over the image
Actual Behavior
No text is written and no exception is thrown
Version of SkiaSharp
3.116.0 (Current)
Last Known Good Version of SkiaSharp
2.88.9 (Previous)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows, Other (Please indicate in the description)
Platform / Operating System Version
Azure App Service for Windows
Devices
No response
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
After further investigation, it seems it is related to text align not getting properly initialized in the latest version of library. Explicitly setting the TextAlign in SKPaint did not help either. There are some TODO comments in SKCanvas.cs (e.g. below). Will you address that TODO somehow in the future versions?
#pragma warning disable CS0618 // Type or member is obsolete (TODO: replace paint.TextAlign with SKTextAlign.Left)
DrawText (text, p, paint.TextAlign, font, paint);
#pragma warning restore CS0618 // Type or member is obsolete
Description
SKCanvas.DrawText cannot write over a SKBitmap in Azure App Service application for Windows but works in the similar application for Azure App Service on Linux. There is no error or exception, it just does not have any effect.
This is a regression because it was working well in 2.88.9 .
Code
SKBitmap skBitmap = SKBitmap.FromImage(skImage);
SKCanvas skCanvas = new SKCanvas(skBitmap);
SKFont skFont = new SKFont(SKTypeface.Default, 16);
SKPaint sKPaint = new SKPaint(skFont);
sKPaint.Color = new SKColor(255, 0, 0);
sKPaint.IsAntialias = true;
skCanvas.DrawText("My Text", 10, 10, sKPaint);
Expected Behavior
A text is written over the image
Actual Behavior
No text is written and no exception is thrown
Version of SkiaSharp
3.116.0 (Current)
Last Known Good Version of SkiaSharp
2.88.9 (Previous)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows, Other (Please indicate in the description)
Platform / Operating System Version
Azure App Service for Windows
Devices
No response
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: