csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
// -----------------------------------------------------------------------
|
|
// <copyright file="StreamGeometry.cs" company="Steven Kirk">
|
|
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|
// </copyright>
|
|
// -----------------------------------------------------------------------
|
|
|
|
namespace Perspex.Media
|
|
{
|
|
using Perspex.Platform;
|
|
using Splat;
|
|
|
|
public class StreamGeometry : Geometry
|
|
{
|
|
public StreamGeometry()
|
|
{
|
|
IPlatformRenderInterface factory = Locator.Current.GetService<IPlatformRenderInterface>();
|
|
this.PlatformImpl = factory.CreateStreamGeometry();
|
|
}
|
|
|
|
public override Rect Bounds
|
|
{
|
|
get { return this.PlatformImpl.Bounds; }
|
|
}
|
|
|
|
public static StreamGeometry Parse(string s)
|
|
{
|
|
StreamGeometry result = new StreamGeometry();
|
|
|
|
using (StreamGeometryContext ctx = result.Open())
|
|
{
|
|
PathMarkupParser parser = new PathMarkupParser(result, ctx);
|
|
parser.Parse(s);
|
|
return result;
|
|
}
|
|
}
|
|
|
|
public StreamGeometryContext Open()
|
|
{
|
|
return new StreamGeometryContext(((IStreamGeometryImpl)this.PlatformImpl).Open());
|
|
}
|
|
}
|
|
}
|
|
|