/// <summary> /// Adds the shading. /// </summary> /// <param name="shading">The shading.</param> /// <returns></returns> public PdfName AddShading(PdfShading shading) { if (shading == null) { throw new PdfArgumentNullException("shading"); } shading.IsLabeled = true; PdfName key = this.manager.AddShading(shading); if (!this.Shadings.ContainsKey(key)) { this.Shadings.Add(key, shading); } return(key); }
/// <summary> /// Creates the specified x0. /// </summary> /// <param name="x0">The x0.</param> /// <param name="y0">The y0.</param> /// <param name="r0">The r0.</param> /// <param name="x1">The x1.</param> /// <param name="y1">The y1.</param> /// <param name="r1">The r1.</param> /// <param name="colors">The colors.</param> /// <param name="offsets">The offsets.</param> /// <param name="extendStart">if set to <c>true</c> [extend start].</param> /// <param name="extendEnd">if set to <c>true</c> [extend end].</param> /// <returns></returns> public static PdfRadialShading Create(float x0, float y0, float r0, float x1, float y1, float r1, List <PdfColor> colors, List <float> offsets, bool extendStart, bool extendEnd) { if ((colors == null) || (colors.Count <= 0)) { throw new PdfArgumentNullException("colors"); } if ((offsets == null) || (offsets.Count <= 0)) { throw new PdfArgumentNullException("offsets"); } float[] domain = new float[2]; domain[1] = 1f; return(new PdfRadialShading(new float[] { x0, y0, r0, x1, y1, r1 }, PdfFunction.Type4(domain, new float[] { 0f, 1f, 0f, 1f, 0f, 1f }, PdfShading.GetPostScriptCode(colors, offsets))) { ExtendStart = extendStart, ExtendEnd = extendEnd }); }
/// <summary> /// Initializes a new instance of the <see cref="T:PdfShadingPattern" /> class. /// </summary> /// <param name="shading">The shading.</param> public PdfShadingPattern(PdfShading shading) : this() { this.shading = shading; }