Exemple #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);
        }
Exemple #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;
                }
            }
        }
Exemple #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());
                }
            }
        }
Exemple #4
0
 void parseRadialGradient(Attributes pAttributes)
 {
     this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, false);
 }
Exemple #5
0
 void parseLinearGradient(Attributes pAttributes)
 {
     this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, true);
 }
Exemple #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;
				}
			}
		}
Exemple #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;
		}
Exemple #8
0
		void parseRadialGradient(Attributes pAttributes) {
			this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, false);
		}
Exemple #9
0
		void parseLinearGradient(Attributes pAttributes) {
			this.mCurrentSVGGradient = this.mSVGPaint.parseGradient(pAttributes, true);
		}