Exemplo n.º 1
0
        public SVGGradient parseGradient(Attributes pAttributes, bool pLinear)
        {
            string id = pAttributes.GetStringAttribute(SVGConstants.ATTRIBUTE_ID);

            if (id == null)
            {
                return(null);
            }

            SVGGradient svgGradient = new SVGGradient(id, pLinear, pAttributes);

            this.mSVGGradientMap[id] = svgGradient;
            return(svgGradient);
        }
Exemplo n.º 2
0
        private void resolveHref(Dictionary <String, SVGGradient> pSVGGradientMap)
        {
            SVGGradient parent = pSVGGradientMap[this.mHref];

            if (parent == null)
            {
                throw new SVGParseException("Could not resolve href: '" + this.mHref + "' of SVGGradient: '" + this.mID + "'.");
            }
            else
            {
                parent.ensureHrefResolved(pSVGGradientMap);
                this.mParent = parent;
                this.mSVGAttributes.setParentSVGAttributes(this.mParent.mSVGAttributes);
                if (this.mSVGGradientStops == null)
                {
                    this.mSVGGradientStops          = this.mParent.mSVGGradientStops;
                    this.mSVGGradientStopsColors    = this.mParent.mSVGGradientStopsColors;
                    this.mSVGGradientStopsPositions = this.mParent.mSVGGradientStopsPositions;
                }
            }
        }
Exemplo n.º 3
0
        Shader getGradientShader(string pGradientShaderID)
        {
            SVGGradient svgGradient = this.mSVGGradientMap[pGradientShaderID];

            if (svgGradient == null)
            {
                throw new SVGParseException("No SVGGradient found for id: '" + pGradientShaderID + "'.");
            }
            else
            {
                Shader gradientShader = svgGradient.getShader();
                if (gradientShader != null)
                {
                    return(gradientShader);
                }
                else
                {
                    svgGradient.ensureHrefResolved(this.mSVGGradientMap);
                    return(svgGradient.createShader());
                }
            }
        }
Exemplo n.º 4
0
 void parseRadialGradient(Attributes pAttributes)
 {
     this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, false);
 }
Exemplo n.º 5
0
 void parseLinearGradient(Attributes pAttributes)
 {
     this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, true);
 }
Exemplo n.º 6
0
		private void resolveHref(Dictionary<String, SVGGradient> pSVGGradientMap) {
			SVGGradient parent = pSVGGradientMap[this.mHref];
			if(parent == null) {
				throw new SVGParseException("Could not resolve href: '" + this.mHref + "' of SVGGradient: '" + this.mID + "'.");
			} else {
				parent.ensureHrefResolved(pSVGGradientMap);
				this.mParent = parent;
				this.mSVGAttributes.setParentSVGAttributes(this.mParent.mSVGAttributes);
				if(this.mSVGGradientStops == null) {
					this.mSVGGradientStops = this.mParent.mSVGGradientStops;
					this.mSVGGradientStopsColors = this.mParent.mSVGGradientStopsColors;
					this.mSVGGradientStopsPositions = this.mParent.mSVGGradientStopsPositions;
				}
			}
		}
Exemplo n.º 7
0
		public SVGGradient parseGradient(Attributes pAttributes, bool pLinear) {
			string id = pAttributes.GetStringAttribute(SVGConstants.ATTRIBUTE_ID);
			if(id == null) {
				return null;
			}

			SVGGradient svgGradient = new SVGGradient(id, pLinear, pAttributes);
			this.mSVGGradientMap[id] = svgGradient;
			return svgGradient;
		}
Exemplo n.º 8
0
		void parseRadialGradient(Attributes pAttributes) {
			this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, false);
		}
Exemplo n.º 9
0
		void parseLinearGradient(Attributes pAttributes) {
			this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, true);
		}