Closed PaulFarry closed 9 months ago
In the Extensions file for Skia
The creation of the Bitmap doesn't allow for a transparent colour to be used for the background.
If it is replaced with the following you can use a colour that includes transparency for the background.
SKBitmap bitmap = new SKBitmap(dim, dim, SKColorType.Rgba8888, SKAlphaType.Premul);
I haven't tested for all cases, but seems to be the minimum required to get transparency.
I did also test using canvas.Clear(background) instead of canvas.DrawRect(0, 0, dim, dim, paint);which also seemed to work
canvas.Clear(background)
canvas.DrawRect(0, 0, dim, dim, paint);
Thanks for the input.
I've updated the extension for Skia to support fully or partially transparent backgrounds. If the background color is not fully opaque, a bitmap with alpha channel will be used.
In the Extensions file for Skia
The creation of the Bitmap doesn't allow for a transparent colour to be used for the background.
If it is replaced with the following you can use a colour that includes transparency for the background.
SKBitmap bitmap = new SKBitmap(dim, dim, SKColorType.Rgba8888, SKAlphaType.Premul);
I haven't tested for all cases, but seems to be the minimum required to get transparency.
I did also test using
canvas.Clear(background)
instead ofcanvas.DrawRect(0, 0, dim, dim, paint);
which also seemed to work