Exemple #1
0
        static void RenderTo(this GeometryDrawing drawing, d.Graphics graphics, double opacity) {
			if (drawing.Geometry == null || drawing.Geometry.IsEmpty()) return; 
			var path = drawing.Geometry.ToGdiPlus();
			var brush = drawing.Brush;
			if (brush != null) {
				if (!Utility.IsZero(opacity - 1)) {
					brush = brush.Clone();
					brush.Opacity *= opacity;
				}
                graphics.FillPath(brush.ToGdiPlus(drawing.Geometry.Bounds), path);
			}
			var pen = drawing.Pen;
			if (pen != null) {
				if (!Utility.IsZero(opacity - 1)) {
					pen = pen.Clone();
					pen.Brush.Opacity *= opacity;
				}
                graphics.DrawPath(pen.ToGdiPlus(drawing.Geometry.GetRenderBounds(pen)), path);
			}
		}