Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Radial Gradient only rendering the last color #286

Open
binber18 opened this issue Sep 16, 2024 · 0 comments
Open

[BUG] Radial Gradient only rendering the last color #286

binber18 opened this issue Sep 16, 2024 · 0 comments
Labels

Comments

@binber18
Copy link

binber18 commented Sep 16, 2024

Description
When rendering radial gradients it seems that the library only renders the last color of that color stack.

Test SVG

Code
using System.Text;
using SkiaSharp;

var svgText = """











""";

var svgBytes = Encoding.UTF8.GetBytes(svgText);

using var svgStream = new MemoryStream(svgBytes);

var svg = new SkiaSharp.Extended.Svg.SKSvg(new SKSize(500, 500));

svg.Load(svgStream);

using var bitmap = new SKBitmap(500, 500);
using var canvas = new SKCanvas(bitmap);

canvas.DrawPicture(svg.Picture);

using var outputStream = new FileStream("test.png", FileMode.Create);
using var image = SKImage.FromBitmap(bitmap);
using var data = image.Encode(SKEncodedImageFormat.Png, 100);

data.SaveTo(outputStream);

Console.WriteLine("Done!");

Expected Behavior

A PNG that with the same Colors as the SVG

Actual Behavior

A PNG that is just blue

Basic Information

  • Version with issue: SkiaSharp 2.88.8, SkiaSharp.Svg 1.60.0
  • Last known good version: /
  • IDE: VS Professional and VS Code
  • Platform Target Frameworks:
    • Windows Classic: Windows 11 Pro
Detailed IDE/OS information (click to expand)

PASTE ANY DETAILED VERSION INFO HERE

Screenshots

SVG:
image

Generated PNG:
image

Reproduction Link

@binber18 binber18 added the bug label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant