コード例 #1
0
 public static void SetTextureRoot(this ImageSharpDrawingInstaller source, string path)
 {
     source.TextureLoader.Add((name) =>
     {
         string p = Path.Combine(path, name);
         return(new ImageSharpTexture(Image.Load(p)));
     });
 }
コード例 #2
0
 public static void SetTextureRoot(this ImageSharpDrawingInstaller source, StorageFolder rootFolder)
 {
     source.TextureLoader.Add((name) =>
     {
         var t = withFileStream <ImageSharpTexture>(rootFolder, name, (s) =>
         {
             return(new ImageSharpTexture(Image.Load(s)));
         });
         t.Wait();
         return(t.Result);
     });
 }
コード例 #3
0
 public static void SetFontRoot(this ImageSharpDrawingInstaller source, string path)
 {
     source.FontLoader.Add((name) =>
     {
         string p   = Path.Combine(path, name);
         var family = source.Fonts.Install(p);
         return(new Font()
         {
             Name = family.Name, Size = 10
         });
     });
 }
コード例 #4
0
 public static void SetFontRoot(this ImageSharpDrawingInstaller source, StorageFolder rootFolder)
 {
     source.FontLoader.Add((name) =>
     {
         var t = withFileStream <Font>(rootFolder, name, (s) =>
         {
             var family = source.Fonts.Install(s);
             return(new Font()
             {
                 Name = family.Name, Size = 10
             });
         });
         t.Wait();
         return(t.Result);
     });
 }