public override void Render(WpfDrawingRenderer renderer) { WpfDrawingContext context = renderer.Context; SvgImageElement imageElement = (SvgImageElement)_svgElement; double x = imageElement.X.AnimVal.Value; double y = imageElement.Y.AnimVal.Value; double width = imageElement.Width.AnimVal.Value; double height = imageElement.Height.AnimVal.Value; Rect destRect = new Rect(x, y, width, height); Rect clipRect = new Rect(x, y, width, height); ImageSource imageSource = null; if (imageElement.IsSvgImage) { if (imageElement.IsRootReferenced(imageElement.OwnerDocument.BaseURI)) { return; } SvgWindow wnd = GetSvgWindow(); if (wnd == null) { return; } //_embeddedRenderer.BackColor = Color.Empty; _embeddedRenderer.Render(wnd.Document); DrawingGroup imageGroup = _embeddedRenderer.Drawing as DrawingGroup; if (imageGroup != null && (imageGroup.Children != null && imageGroup.Children.Count == 1)) { DrawingGroup imageDrawing = imageGroup.Children[0] as DrawingGroup; if (imageDrawing != null) { imageDrawing.ClipGeometry = null; imageSource = new DrawingImage(imageDrawing); } else { imageGroup.ClipGeometry = null; imageSource = new DrawingImage(imageGroup); } } else { imageSource = new DrawingImage(_embeddedRenderer.Drawing); } if (_embeddedRenderer != null) { _embeddedRenderer.Dispose(); _embeddedRenderer = null; } } else { imageSource = GetBitmapSource(imageElement, context); } if (imageSource == null) { return; } //TODO--PAUL: Set the DecodePixelWidth/DecodePixelHeight? // Freeze the DrawingImage for performance benefits. //imageSource.Freeze(); DrawingGroup drawGroup = null; ISvgAnimatedPreserveAspectRatio animatedAspectRatio = imageElement.PreserveAspectRatio; if (animatedAspectRatio != null && animatedAspectRatio.AnimVal != null) { SvgPreserveAspectRatio aspectRatio = animatedAspectRatio.AnimVal as SvgPreserveAspectRatio; SvgPreserveAspectRatioType aspectRatioType = (aspectRatio != null) ? aspectRatio.Align : SvgPreserveAspectRatioType.Unknown; if (aspectRatio != null && aspectRatioType != SvgPreserveAspectRatioType.None && aspectRatioType != SvgPreserveAspectRatioType.Unknown) { double imageWidth = imageSource.Width; double imageHeight = imageSource.Height; double viewWidth = destRect.Width; double viewHeight = destRect.Height; SvgMeetOrSlice meetOrSlice = aspectRatio.MeetOrSlice; if (meetOrSlice == SvgMeetOrSlice.Meet) { if (imageWidth <= viewWidth && imageHeight <= viewHeight) { if (this.Transform == null) { if (!aspectRatio.IsDefaultAlign) // Cacxa { destRect = this.GetBounds(destRect, new Size(imageWidth, imageHeight), aspectRatioType); } else { Transform viewTransform = this.GetAspectRatioTransform(aspectRatio, new SvgRect(0, 0, imageWidth, imageHeight), new SvgRect(destRect.X, destRect.Y, destRect.Width, destRect.Height)); if (viewTransform != null) { drawGroup = new DrawingGroup(); drawGroup.Transform = viewTransform; DrawingGroup lastGroup = context.Peek(); Debug.Assert(lastGroup != null); if (lastGroup != null) { lastGroup.Children.Add(drawGroup); } destRect = this.GetBounds(destRect, new Size(imageWidth, imageHeight), aspectRatioType); // The origin is already handled by the view transform... destRect.X = 0; destRect.Y = 0; } } } else { destRect = new Rect(0, 0, viewWidth, viewHeight); } } else { if (this.Transform == null) { Transform viewTransform = this.GetAspectRatioTransform(aspectRatio, new SvgRect(0, 0, imageWidth, imageHeight), new SvgRect(destRect.X, destRect.Y, destRect.Width, destRect.Height)); if (viewTransform != null) { drawGroup = new DrawingGroup(); drawGroup.Transform = viewTransform; DrawingGroup lastGroup = context.Peek(); Debug.Assert(lastGroup != null); if (lastGroup != null) { lastGroup.Children.Add(drawGroup); } destRect = this.GetBounds(destRect, new Size(imageWidth, imageHeight), aspectRatioType); // The origin is already handled by the view transform... destRect.X = 0; destRect.Y = 0; } } } } else if (meetOrSlice == SvgMeetOrSlice.Slice) { var fScaleX = viewWidth / imageWidth; var fScaleY = viewHeight / imageHeight; Transform viewTransform = this.GetAspectRatioTransform(aspectRatio, new SvgRect(0, 0, imageWidth, imageHeight), new SvgRect(destRect.X, destRect.Y, destRect.Width, destRect.Height)); DrawingGroup sliceGroup = new DrawingGroup(); sliceGroup.ClipGeometry = new RectangleGeometry(clipRect); DrawingGroup lastGroup = context.Peek(); Debug.Assert(lastGroup != null); if (lastGroup != null) { lastGroup.Children.Add(sliceGroup); } if (viewTransform != null) { drawGroup = new DrawingGroup(); drawGroup.Transform = viewTransform; sliceGroup.Children.Add(drawGroup); destRect = this.GetBounds(destRect, new Size(imageWidth, imageHeight), aspectRatioType); // The origin is already handled by the view transform... destRect.X = 0; destRect.Y = 0; } else { drawGroup = sliceGroup; } } } } ImageDrawing drawing = new ImageDrawing(imageSource, destRect); float opacityValue = -1; string opacity = imageElement.GetAttribute("opacity"); if (string.IsNullOrWhiteSpace(opacity)) { opacity = imageElement.GetPropertyValue("opacity"); } if (!string.IsNullOrWhiteSpace(opacity)) { opacityValue = (float)SvgNumber.ParseNumber(opacity); opacityValue = Math.Min(opacityValue, 1); opacityValue = Math.Max(opacityValue, 0); } Geometry clipGeom = this.ClipGeometry; Transform transform = this.Transform; bool ownedGroup = true; if (drawGroup == null) { drawGroup = context.Peek(); ownedGroup = false; } Debug.Assert(drawGroup != null); if (drawGroup != null) { if ((opacityValue >= 0 && opacityValue < 1) || (clipGeom != null && !clipGeom.IsEmpty()) || (transform != null && !transform.Value.IsIdentity)) { DrawingGroup clipGroup = ownedGroup ? drawGroup : new DrawingGroup(); if (opacityValue >= 0 && opacityValue < 1) { clipGroup.Opacity = opacityValue; } if (clipGeom != null) { SvgUnitType clipUnits = this.ClipUnits; if (clipUnits == SvgUnitType.ObjectBoundingBox) { Rect drawingBounds = drawing.Bounds; TransformGroup transformGroup = new TransformGroup(); // Scale the clip region (at (0, 0)) and translate to the top-left corner of the target. transformGroup.Children.Add( new ScaleTransform(drawingBounds.Width, drawingBounds.Height)); transformGroup.Children.Add( new TranslateTransform(drawingBounds.X, drawingBounds.Y)); clipGeom.Transform = transformGroup; } clipGroup.ClipGeometry = clipGeom; } if (transform != null) { Transform curTransform = clipGroup.Transform; if (curTransform != null && curTransform.Value.IsIdentity == false) { TransformGroup transformGroup = new TransformGroup(); transformGroup.Children.Add(curTransform); transformGroup.Children.Add(transform); clipGroup.Transform = transformGroup; } else { clipGroup.Transform = transform; } } clipGroup.Children.Add(drawing); if (!ownedGroup) { drawGroup.Children.Add(clipGroup); } } else { drawGroup.Children.Add(drawing); } string elementId = this.GetElementName(); if (ownedGroup) { string sVisibility = imageElement.GetPropertyValue("visibility"); string sDisplay = imageElement.GetPropertyValue("display"); if (string.Equals(sVisibility, "hidden") || string.Equals(sDisplay, "none")) { drawGroup.Opacity = 0; } if (!_idAssigned && !string.IsNullOrWhiteSpace(elementId) && !context.IsRegisteredId(elementId)) { context.RegisterId(elementId); if (context.IncludeRuntime) { SvgObject.SetName(drawGroup, elementId); SvgObject.SetId(drawGroup, elementId); } } // Register this drawing with the Drawing-Document... this.Rendered(drawGroup); } else if (!_idAssigned) { if (!_idAssigned && !string.IsNullOrWhiteSpace(elementId) && !context.IsRegisteredId(elementId)) { context.RegisterId(elementId); if (context.IncludeRuntime) { SvgObject.SetName(imageSource, elementId); SvgObject.SetId(imageSource, elementId); } } // Register this drawing with the Drawing-Document... this.Rendered(drawing); } } }
public SvgPreserveAspectRatio(string attr, SvgElement ownerElement) { _ownerElement = ownerElement; Match match = parCheck.Match(attr.Trim()); if (match.Groups["align"].Success) { switch (match.Groups["align"].Value) { case CssConstants.ValNone: _alignment = SvgPreserveAspectRatioType.None; break; case "xMinYMin": _alignment = SvgPreserveAspectRatioType.XMinYMin; break; case "xMidYMin": _alignment = SvgPreserveAspectRatioType.XMidYMin; break; case "xMaxYMin": _alignment = SvgPreserveAspectRatioType.XMaxYMin; break; case "xMinYMid": _alignment = SvgPreserveAspectRatioType.XMinYMid; break; case "xMaxYMid": _alignment = SvgPreserveAspectRatioType.XMaxYMid; break; case "xMinYMax": _alignment = SvgPreserveAspectRatioType.XMinYMax; break; case "xMidYMax": _alignment = SvgPreserveAspectRatioType.XMidYMax; break; case "xMaxYMax": _alignment = SvgPreserveAspectRatioType.XMaxYMax; break; default: _alignment = SvgPreserveAspectRatioType.XMidYMid; _isDefaultAlign = true; break; } } else { _alignment = SvgPreserveAspectRatioType.XMidYMid; _isDefaultAlign = true; } if (match.Groups["meet"].Success) { _isDefaultAlign = false; switch (match.Groups["meet"].Value) { case "slice": _meetOrSlice = SvgMeetOrSlice.Slice; break; case "meet": _meetOrSlice = SvgMeetOrSlice.Meet; break; case "": _meetOrSlice = SvgMeetOrSlice.Meet; break; default: _meetOrSlice = SvgMeetOrSlice.Unknown; break; } } else { _meetOrSlice = SvgMeetOrSlice.Meet; } }
public override void Render(GdiGraphicsRenderer renderer) { base.Render(renderer); var graphics = renderer.GdiGraphics; SvgImageElement iElement = (SvgImageElement)_svgElement; ImageAttributes imageAttributes = new ImageAttributes(); float opacityValue = -1; string opacity = iElement.GetAttribute("opacity"); if (string.IsNullOrWhiteSpace(opacity)) { opacity = iElement.GetPropertyValue("opacity"); } if (!string.IsNullOrWhiteSpace(opacity)) { opacityValue = (float)SvgNumber.ParseNumber(opacity); opacityValue = Math.Min(opacityValue, 1); opacityValue = Math.Max(opacityValue, 0); } if (opacityValue >= 0 && opacityValue < 1) { ColorMatrix colorMatrix = new ColorMatrix(); colorMatrix.Matrix00 = 1.00f; // Red colorMatrix.Matrix11 = 1.00f; // Green colorMatrix.Matrix22 = 1.00f; // Blue colorMatrix.Matrix33 = opacityValue; // alpha colorMatrix.Matrix44 = 1.00f; // w imageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); } float width = (float)iElement.Width.AnimVal.Value; float height = (float)iElement.Height.AnimVal.Value; RectangleF destRect = new RectangleF((float)iElement.X.AnimVal.Value, (float)iElement.Y.AnimVal.Value, (float)iElement.Width.AnimVal.Value, (float)iElement.Height.AnimVal.Value); RectangleF srcRect; RectangleF clipRect = destRect; // var container = graphics.BeginContainer(); graphics.SetClip(new Region(clipRect), CombineMode.Intersect); Image image = null; SvgWindow svgWnd = null; if (iElement.IsSvgImage) { svgWnd = GetSvgWindow(graphics); if (width > 0 && height > 0) { srcRect = new RectangleF(0, 0, width, height); } else { SvgSvgElement svgEl = (SvgSvgElement)svgWnd.Document.RootElement; SvgSizeF size = svgEl.GetSize(); srcRect = new RectangleF(new PointF(0, 0), new SizeF(size.Width, size.Height)); } } else { image = GetBitmap(iElement); if (image == null) { return; } srcRect = new RectangleF(0, 0, image.Width, image.Height); } ISvgAnimatedPreserveAspectRatio animatedAspectRatio = iElement.PreserveAspectRatio; if (animatedAspectRatio != null && animatedAspectRatio.AnimVal != null) { SvgPreserveAspectRatio aspectRatio = animatedAspectRatio.AnimVal as SvgPreserveAspectRatio; SvgPreserveAspectRatioType aspectRatioType = (aspectRatio != null) ? aspectRatio.Align : SvgPreserveAspectRatioType.Unknown; if (aspectRatio != null && aspectRatioType != SvgPreserveAspectRatioType.None && aspectRatioType != SvgPreserveAspectRatioType.Unknown) { var fScaleX = destRect.Width / srcRect.Width; var fScaleY = destRect.Height / srcRect.Height; var xOffset = 0.0f; var yOffset = 0.0f; SvgMeetOrSlice meetOrSlice = aspectRatio.MeetOrSlice; if (meetOrSlice == SvgMeetOrSlice.Slice) { fScaleX = Math.Max(fScaleX, fScaleY); fScaleY = Math.Max(fScaleX, fScaleY); } else { fScaleX = Math.Min(fScaleX, fScaleY); fScaleY = Math.Min(fScaleX, fScaleY); } switch (aspectRatioType) { case SvgPreserveAspectRatioType.XMinYMin: break; case SvgPreserveAspectRatioType.XMidYMin: xOffset = (destRect.Width - srcRect.Width * fScaleX) / 2; break; case SvgPreserveAspectRatioType.XMaxYMin: xOffset = (destRect.Width - srcRect.Width * fScaleX); break; case SvgPreserveAspectRatioType.XMinYMid: yOffset = (destRect.Height - srcRect.Height * fScaleY) / 2; break; case SvgPreserveAspectRatioType.XMidYMid: xOffset = (destRect.Width - srcRect.Width * fScaleX) / 2; yOffset = (destRect.Height - srcRect.Height * fScaleY) / 2; break; case SvgPreserveAspectRatioType.XMaxYMid: xOffset = (destRect.Width - srcRect.Width * fScaleX); yOffset = (destRect.Height - srcRect.Height * fScaleY) / 2; break; case SvgPreserveAspectRatioType.XMinYMax: yOffset = (destRect.Height - srcRect.Height * fScaleY); break; case SvgPreserveAspectRatioType.XMidYMax: xOffset = (destRect.Width - srcRect.Width * fScaleX) / 2; yOffset = (destRect.Height - srcRect.Height * fScaleY); break; case SvgPreserveAspectRatioType.XMaxYMax: xOffset = (destRect.Width - srcRect.Width * fScaleX); yOffset = (destRect.Height - srcRect.Height * fScaleY); break; } destRect = new RectangleF(destRect.X + xOffset, destRect.Y + yOffset, srcRect.Width * fScaleX, srcRect.Height * fScaleY); } if (image != null) { SvgColorProfileElement colorProfile = (SvgColorProfileElement)iElement.ColorProfile; if (colorProfile != null) { SvgUriReference svgUri = colorProfile.UriReference; Uri profileUri = new Uri(svgUri.AbsoluteUri); imageAttributes.SetOutputChannelColorProfile(profileUri.LocalPath, ColorAdjustType.Default); } graphics.DrawImage(this, image, destRect, srcRect, GraphicsUnit.Pixel, imageAttributes); image.Dispose(); image = null; } else if (iElement.IsSvgImage && svgWnd != null) { svgWnd.Resize((int)srcRect.Width, (int)srcRect.Height); var currOffset = new PointF(graphics.Transform.OffsetX, graphics.Transform.OffsetY); if (!currOffset.IsEmpty) { graphics.TranslateTransform(-currOffset.X, -currOffset.Y); } graphics.ScaleTransform(destRect.Width / srcRect.Width, destRect.Height / srcRect.Height); if (!currOffset.IsEmpty) { graphics.TranslateTransform(currOffset.X + destRect.X, currOffset.Y + destRect.Y); } _embeddedRenderer.Render(svgWnd.Document); } graphics.ResetClip(); // graphics.EndContainer(container); } if (_embeddedRenderer != null) { _embeddedRenderer.GdiGraphics = null; _embeddedRenderer.Dispose(); _embeddedRenderer = null; } if (imageAttributes != null) { imageAttributes.Dispose(); imageAttributes = null; } }
public override void Render(WpfDrawingRenderer renderer) { WpfDrawingContext context = renderer.Context; SvgImageElement imageElement = (SvgImageElement)_svgElement; double width = imageElement.Width.AnimVal.Value; double height = imageElement.Height.AnimVal.Value; Rect destRect = new Rect(imageElement.X.AnimVal.Value, imageElement.Y.AnimVal.Value, width, height); ImageSource imageSource = null; if (imageElement.IsSvgImage) { SvgWindow wnd = GetSvgWindow(); //_embeddedRenderer.BackColor = Color.Empty; _embeddedRenderer.Render(wnd.Document); DrawingGroup imageGroup = _embeddedRenderer.Drawing as DrawingGroup; if (imageGroup != null && (imageGroup.Children != null && imageGroup.Children.Count == 1)) { DrawingGroup drawImage = imageGroup.Children[0] as DrawingGroup; if (drawImage != null) { if (drawImage.ClipGeometry != null) { drawImage.ClipGeometry = null; } imageSource = new DrawingImage(drawImage); } else { if (imageGroup.ClipGeometry != null) { imageGroup.ClipGeometry = null; } imageSource = new DrawingImage(imageGroup); } } else { imageSource = new DrawingImage(_embeddedRenderer.Drawing); } if (_embeddedRenderer != null) { _embeddedRenderer.Dispose(); _embeddedRenderer = null; } } else { imageSource = GetBitmapSource(imageElement, context); } if (imageSource == null) { return; } //TODO--PAUL: Set the DecodePixelWidth/DecodePixelHeight? // Freeze the DrawingImage for performance benefits. imageSource.Freeze(); DrawingGroup drawGroup = null; ISvgAnimatedPreserveAspectRatio animatedAspectRatio = imageElement.PreserveAspectRatio; if (animatedAspectRatio != null && animatedAspectRatio.AnimVal != null) { SvgPreserveAspectRatio aspectRatio = animatedAspectRatio.AnimVal as SvgPreserveAspectRatio; SvgPreserveAspectRatioType aspectRatioType = (aspectRatio != null) ? aspectRatio.Align : SvgPreserveAspectRatioType.Unknown; if (aspectRatio != null && aspectRatioType != SvgPreserveAspectRatioType.None && aspectRatioType != SvgPreserveAspectRatioType.Unknown) { double imageWidth = imageSource.Width; double imageHeight = imageSource.Height; double viewWidth = destRect.Width; double viewHeight = destRect.Height; SvgMeetOrSlice meetOrSlice = aspectRatio.MeetOrSlice; if (meetOrSlice == SvgMeetOrSlice.Meet) { if (imageWidth <= viewWidth && imageHeight <= viewHeight) { destRect = this.GetBounds(destRect, new Size(imageWidth, imageHeight), aspectRatioType); } else { Transform viewTransform = this.GetAspectRatioTransform(aspectRatio, new SvgRect(0, 0, imageWidth, imageHeight), new SvgRect(destRect.X, destRect.Y, destRect.Width, destRect.Height)); //Transform scaleTransform = this.FitToViewbox(aspectRatio, // new SvgRect(destRect.X, destRect.Y, imageWidth, imageHeight), // new SvgRect(destRect.X, destRect.Y, destRect.Width, destRect.Height)); if (viewTransform != null) { drawGroup = new DrawingGroup(); drawGroup.Transform = viewTransform; DrawingGroup lastGroup = context.Peek(); Debug.Assert(lastGroup != null); if (lastGroup != null) { lastGroup.Children.Add(drawGroup); } destRect = this.GetBounds(destRect, new Size(imageWidth, imageHeight), aspectRatioType); // The origin is already handled by the view transform... destRect.X = 0; destRect.Y = 0; } } } else if (meetOrSlice == SvgMeetOrSlice.Slice) { } } } ImageDrawing drawing = new ImageDrawing(imageSource, destRect); float opacityValue = -1; string opacity = imageElement.GetAttribute("opacity"); if (opacity != null && opacity.Length > 0) { opacityValue = (float)SvgNumber.ParseNumber(opacity); opacityValue = Math.Min(opacityValue, 1); opacityValue = Math.Max(opacityValue, 0); } Geometry clipGeom = this.ClipGeometry; Transform transform = this.Transform; if (drawGroup == null) { drawGroup = context.Peek(); } Debug.Assert(drawGroup != null); if (drawGroup != null) { if (opacityValue >= 0 || (clipGeom != null && !clipGeom.IsEmpty()) || (transform != null && !transform.Value.IsIdentity)) { DrawingGroup clipGroup = new DrawingGroup(); if (opacityValue >= 0) { clipGroup.Opacity = opacityValue; } if (clipGeom != null) { SvgUnitType clipUnits = this.ClipUnits; if (clipUnits == SvgUnitType.ObjectBoundingBox) { Rect drawingBounds = drawing.Bounds; TransformGroup transformGroup = new TransformGroup(); // Scale the clip region (at (0, 0)) and translate to the top-left corner of the target. transformGroup.Children.Add( new ScaleTransform(drawingBounds.Width, drawingBounds.Height)); transformGroup.Children.Add( new TranslateTransform(drawingBounds.X, drawingBounds.Y)); clipGeom.Transform = transformGroup; } clipGroup.ClipGeometry = clipGeom; } if (transform != null) { clipGroup.Transform = transform; } clipGroup.Children.Add(drawing); drawGroup.Children.Add(clipGroup); } else { drawGroup.Children.Add(drawing); } } }
public SvgPreserveAspectRatio(string attr, SvgElement ownerElement) { this.ownerElement = ownerElement; Match match = parCheck.Match(attr.Trim()); if(match.Groups["align"].Success) { switch(match.Groups["align"].Value) { case "none": align = SvgPreserveAspectRatioType.None; break; case "xMinYMin": align = SvgPreserveAspectRatioType.XMinYMin; break; case "xMidYMin": align = SvgPreserveAspectRatioType.XMidYMin; break; case "xMaxYMin": align = SvgPreserveAspectRatioType.XMaxYMin; break; case "xMinYMid": align = SvgPreserveAspectRatioType.XMinYMid; break; case "xMaxYMid": align = SvgPreserveAspectRatioType.XMaxYMid; break; case "xMinYMax": align = SvgPreserveAspectRatioType.XMinYMax; break; case "xMidYMax": align = SvgPreserveAspectRatioType.XMidYMax; break; case "xMaxYMax": align = SvgPreserveAspectRatioType.XMaxYMax; break; default: align = SvgPreserveAspectRatioType.XMidYMid; break; } } else { align = SvgPreserveAspectRatioType.XMidYMid; } if(match.Groups["meet"].Success) { switch(match.Groups["meet"].Value) { case "slice": meetOrSlice = SvgMeetOrSlice.Slice; break; case "meet": meetOrSlice = SvgMeetOrSlice.Meet; break; case "": meetOrSlice = SvgMeetOrSlice.Meet; break; default: meetOrSlice = SvgMeetOrSlice.Unknown; break; } } else { meetOrSlice = SvgMeetOrSlice.Meet; } }
public SvgPreserveAspectRatio(string attr, SvgElement ownerElement) { this.ownerElement = ownerElement; Match match = parCheck.Match(attr.Trim()); if (match.Groups["align"].Success) { switch (match.Groups["align"].Value) { case "none": _alignment = SvgPreserveAspectRatioType.None; break; case "xMinYMin": _alignment = SvgPreserveAspectRatioType.XMinYMin; break; case "xMidYMin": _alignment = SvgPreserveAspectRatioType.XMidYMin; break; case "xMaxYMin": _alignment = SvgPreserveAspectRatioType.XMaxYMin; break; case "xMinYMid": _alignment = SvgPreserveAspectRatioType.XMinYMid; break; case "xMaxYMid": _alignment = SvgPreserveAspectRatioType.XMaxYMid; break; case "xMinYMax": _alignment = SvgPreserveAspectRatioType.XMinYMax; break; case "xMidYMax": _alignment = SvgPreserveAspectRatioType.XMidYMax; break; case "xMaxYMax": _alignment = SvgPreserveAspectRatioType.XMaxYMax; break; default: _alignment = SvgPreserveAspectRatioType.XMidYMid; break; } } else { //TODO--PAUL: align = SvgPreserveAspectRatioType.XMidYMid; _alignment = SvgPreserveAspectRatioType.XMidYMid; } if (match.Groups["meet"].Success) { switch (match.Groups["meet"].Value) { case "slice": _meetOrSlice = SvgMeetOrSlice.Slice; break; case "meet": _meetOrSlice = SvgMeetOrSlice.Meet; break; case "": _meetOrSlice = SvgMeetOrSlice.Meet; break; default: _meetOrSlice = SvgMeetOrSlice.Unknown; break; } } else { _meetOrSlice = SvgMeetOrSlice.Meet; } }