示例#1
0
        public static ImageSource FromSvgPath(string path,
                                              int vectorWidth = 0, int vectorHeight = 0,
                                              Color fillColor = default(Color), FFImageSourceOptions options = null)
        {
            FFImageSource.AssemblyCache = FFImageSource.AssemblyCache ?? Assembly.GetCallingAssembly();

            return(SvgFFImageSource.Create(path, vectorWidth, vectorHeight, fillColor, null, options));
        }
示例#2
0
        public static FFImageSource Create(string path, FFImageSourceOptions options)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(null);
            }

            return(new FFImageSource
            {
                Path = path,
                Options = options,
            });
        }
示例#3
0
        public static StreamFFImageSource Create(Func <Stream> stream, string key, FFImageSourceOptions options)
        {
            if (stream == null)
            {
                return(null);
            }

            key = key ?? stream.GetHashCode().ToString();

            return(new StreamFFImageSource
            {
                Stream = token => Task.Run(() => stream(), token),
                Key = key,
                Options = options,
            });
        }
示例#4
0
        public static SvgStreamFFImageSource Create(
            Func <Stream> stream, string key, int vectorWidth, int vectorHeight,
            Color fillColor, Dictionary <string, string> replaceStringMap, FFImageSourceOptions options)
        {
            if (stream == null)
            {
                return(null);
            }

            key = key ?? stream.GetHashCode().ToString();


            return(new SvgStreamFFImageSource
            {
                Stream = token => Task.Run(() => stream(), token),
                Key = key,
                FillColor = fillColor,
                VectorWidth = vectorWidth,
                VectorHeight = vectorHeight,
                ReplaceStringMap = replaceStringMap,
                Options = options,
            });
        }
示例#5
0
        public static SvgFFImageSource Create(string path, int vectorWidth, int vectorHeight,
                                              Color fillColor, Dictionary <string, string> replaceStringMap, FFImageSourceOptions options)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(null);
            }

            return(new SvgFFImageSource
            {
                Path = path,
                FillColor = fillColor,
                VectorWidth = vectorWidth,
                VectorHeight = vectorHeight,
                ReplaceStringMap = replaceStringMap,
                Options = options,
            });
        }
示例#6
0
 public static ImageSource FromSvgStream(Func <Stream> stream, string key = null,
                                         int vectorWidth = 0, int vectorHeight = 0,
                                         Color fillColor = default(Color), FFImageSourceOptions options = null)
 {
     return(SvgStreamFFImageSource.Create(stream, key, vectorWidth, vectorHeight, fillColor, null, options));
 }
示例#7
0
        public static ImageSource FromPath(string path, FFImageSourceOptions options = null)
        {
            FFImageSource.AssemblyCache = FFImageSource.AssemblyCache ?? Assembly.GetCallingAssembly();

            return(FFImageSource.Create(path, options));
        }
示例#8
0
 public static ImageSource FromStream(Func <Stream> stream, string key = null, FFImageSourceOptions options = null)
 {
     return(StreamFFImageSource.Create(stream, key, options));
 }