From: Jeff R. <jef...@us...> - 2005-09-11 18:26:17
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorRenderingEngine/SharpVectors/Renderer/Gdi/Paint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17902/src/SharpVectorRenderingEngine/SharpVectors/Renderer/Gdi/Paint Modified Files: GdiSvgColor.cs GdiSvgPaint.cs GradientPaintServer.cs Log Message: Small rendering corrections in paint servers, gradients, and re-rendering Index: GdiSvgColor.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorRenderingEngine/SharpVectors/Renderer/Gdi/Paint/GdiSvgColor.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GdiSvgColor.cs 27 Mar 2003 13:40:52 -0000 1.2 --- GdiSvgColor.cs 11 Sep 2005 18:26:09 -0000 1.3 *************** *** 17,21 **** } ! private int getOpacity() { string propName; --- 17,21 ---- } ! public int getOpacity() { string propName; Index: GradientPaintServer.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorRenderingEngine/SharpVectors/Renderer/Gdi/Paint/GradientPaintServer.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GradientPaintServer.cs 19 Apr 2003 20:26:16 -0000 1.4 --- GradientPaintServer.cs 11 Sep 2005 18:26:09 -0000 1.5 *************** *** 7,10 **** --- 7,11 ---- using SharpVectors.Dom.Svg; using SharpVectors.Dom.Css; + using System.Runtime.InteropServices; namespace SharpVectors.Renderer.Gdi *************** *** 329,333 **** // brush.Transform = svgTList.matrix.matrix; ! /* * How to do brush.GammaCorrection = true on a PathGradientBrush? / nikgus * */ --- 330,343 ---- // brush.Transform = svgTList.matrix.matrix; ! if(res.GetPropertyValue("color-interpolation")=="linearRGB") ! { ! //GdipSetPathGradientGammaCorrection(brush, true); ! } ! else ! { ! //GdipSetPathGradientGammaCorrection(brush, false); ! } ! ! /* * How to do brush.GammaCorrection = true on a PathGradientBrush? / nikgus * */ *************** *** 392,395 **** --- 402,409 ---- } + + [DllImport("gdiplus.dll")] + static internal extern int GdipSetPathGradientGammaCorrection (IntPtr brush, bool gamma); + #endregion } Index: GdiSvgPaint.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorRenderingEngine/SharpVectors/Renderer/Gdi/Paint/GdiSvgPaint.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GdiSvgPaint.cs 12 Feb 2005 17:26:56 -0000 1.7 --- GdiSvgPaint.cs 11 Sep 2005 18:26:09 -0000 1.8 *************** *** 182,185 **** --- 182,197 ---- lgb.LinearColors[i] = Color.FromArgb(opacityl, lgb.LinearColors[i]); } + } else if (br is PathGradientBrush) + { + PathGradientBrush pgb = (PathGradientBrush)br; + int opacityl = getOpacity(propPrefix); + for (int i = 0; i < pgb.InterpolationColors.Colors.Length; i++) + { + pgb.InterpolationColors.Colors[i] = Color.FromArgb(opacityl, pgb.InterpolationColors.Colors[i]); + } + for (int i = 0; i < pgb.SurroundColors.Length; i++) + { + pgb.SurroundColors[i] = Color.FromArgb(opacityl, pgb.SurroundColors[i]); + } } return br; |