Problem rendering gradient fills

Topics: SVG, SVG# and Parsing, WPF and GDI+ Renderers
Feb 7, 2011 at 3:41 AM
Edited Feb 7, 2011 at 3:42 AM

I have a problem with SharpVectors rendering gradient fills.

 

Here are three files that reproduce the problem:

http://www.codefurnace.com/pipe1.svg
http://www.codefurnace.com/pipe3.svg
http://www.codefurnace.com/pipe4.svg

You may be able to see, on pipe1.svg the gradient fill is rendered 90 degrees sideways. On pipe4.svg the radius gradient isn't even rendered. I'm using the GDI renderer in a WinForms application.

Any suggestions on how to fix it would be very helpful, or if I'm doing something wrong in the WinForms app, I'm keeping the SVG files in a resource file compiled in the application, and loading them from a stream.

Thanks...

-Ron 

Coordinator
Feb 7, 2011 at 4:23 AM
Edited Feb 7, 2011 at 4:24 AM

Hello Ron,

Thanks for reporting this and for making the test samples available.

I have confirmed the problem in the GDI renderer, which is less complete compared to the WPF renderer.
Even the WPF renderer is having problem too...

pipe1.svg - correctly rendered
pipe3.svg - a portion not correctly rendered
pipe4.svg - a portion not correctly rendered.

I will be working on the fix as soon as possible. My other open source project (for Sandcastle Documentation, which
I wish to use to document this project) is really taking a lot of my time.

Best regards,
Paul. 

Feb 7, 2011 at 4:29 AM

Thanks for the quick reply. I'm looking forward to the fix, I've been trying to dig through the source code and I can't manage to find the problem area's myself.

-Ron

 

Coordinator
Feb 7, 2011 at 5:38 AM

Hello Ron,

Nice to hear you have investigated the problem. Looking at the SVG files, each gradient is defined with a transformation,
and most parts of the diagram are also defined with transformations.

So, in the case of the GDI, it is very likely the gradient transforms are not applied or at least not properly. For the WPF, where
I can tell the gradient transforms are applied, something is still missing or not well done :)

The approach will be to fix the WPF renderer to render those files correctly, then port that to the GDI. I will get back to you soon.

Best regards,
Paul. 

Coordinator
Feb 12, 2011 at 11:08 PM

Hello Ron,

I have fixed this issue in the WPF renderer and have updated the sources.
The GDI renderer fix requires more work, since that renderer is currently dated. 

I am working on the GDI renderer now to fix this issue. Sorry for the delay.

Best regards,
Paul. 

Coordinator
Feb 12, 2011 at 11:15 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.