Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public static FFImageSource Create(string path, FFImageSourceOptions options)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(null);
            }

            return(new FFImageSource
            {
                Path = path,
                Options = options,
            });
        }
Exemplo n.º 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,
            });
        }
Exemplo n.º 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,
            });
        }
Exemplo n.º 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,
            });
        }
Exemplo n.º 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));
 }
Exemplo n.º 7
0
        public static ImageSource FromPath(string path, FFImageSourceOptions options = null)
        {
            FFImageSource.AssemblyCache = FFImageSource.AssemblyCache ?? Assembly.GetCallingAssembly();

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