ReaderWMF & Gradient - Printable Version
+- AB4D Forum (https://forum.ab4d.com)
+-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4)
+--- Forum: Paste2Xaml and Ab2d.ReaderWmf (https://forum.ab4d.com/forumdisplay.php?fid=7)
+--- Thread: ReaderWMF & Gradient (/showthread.php?tid=45)
ReaderWMF & Gradient - abody - 06-30-2010
I have a simple question:
Does the ReaderWMF treats the gradient color?
Because I have test to import an EMF file with gradient color from my favorite software Visio 2003. After transformation, the XAML string contains a drawing with many SolidColorBrush as ressources but they are never used.
My image is white when I use :
It that a normal behaviour ?
RE: ReaderWMF & Gradient - abenedik - 07-01-2010
Actually enhanced metafile could theoretically use gradients - at least there is a EMR_GRADIENTFILL record type. But so far I have not seen a single emf file that would use it (and I have seen lots of them).
Instead, gradients are composed of many polygons that stick together and where each of them have slightly different fill color defined - the colors that you saw defined in the resources (they are surely used in the XAML below).
This can be easily observed when you export your drawing as Shapes (instead of Geometries). For example:
But unfortunately there is a problem with this approach in WPF. It looks like there is a bug or some other problem in WPF that draws lines between two polygons or rectangles that lie one by another - actually have 2 points with the same coordinates. There should be no empty space between than (in GDI rendering of metafile there is no empty space), but in WPF you could see a thick line between them. Strange is that you can zoom in to the line and the line will still be very thick.
I am still not sure how to overcome this problem.
I have just posted a bug about it to Microsoft Connect:
I am not expecting any quick solution from them, but I think that they should be aver of this problem.
If anybody is having any idea, you are most welcome.