Apr 8, 2012 at 10:07 AM
Edited Apr 8, 2012 at 10:18 AM
I had included the renderer in one of my projects. It had been a pity no filter functions, and the gradient with Gdi+ does not seem to be compliant with svg. With limited time available, in the past months I had built up the filter functions gradually and
created work arounds to improve the gradient display, and by the way fixed some bugs. It is uploaded now (ID: 11924). I am not the co-worker for this project. It is just to share if someone may want to continue the work...
Most of the functions are tested and work well for >95% of svg cliparts from Open ClipArt library, except below functions do not yet work properly, or are not yet implemented:
- Lighting filters - works for the example in SVG 1.1 spec, but does not work properly for some other examples
- BackgroundImage - not yet implemented but tentatively use device canvas as work around, still works well for most of examples
- FillPaint and StrokePaint - do not quick understand them, not yet implemented
- Minor color difference for ConvolveMatrix and ColorMatrix
Since pixel operations with managed codes for filter functions may be slow, I had used LockBit in unsafe way to access bitmap. It can be much faster though not recommended in general. You may change it to managed code if your project does not allow
it, but take care of the speed (could be very slow)
I will still have very limited time for further work on this. If you are interested in the codes, feel free to improve it and share back....
By the way, a viewer is included in the patch. It is more convient for debug. There are 2 display windows: the left one displays the rendered image, the right one displays selected intermediate result out from filter. Read the codes in Svgfilter.sc,
you will see how to do...