Support data URI as Icon

This commit is contained in:
Yeechan Lu
2014-03-23 04:22:57 +08:00
parent 0d95636b0f
commit 7dda2df54b
4 changed files with 80 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
namespace Wox
{
@@ -40,6 +41,11 @@ namespace Wox
if (values[0] == null) return null;
string path = values[0].ToString();
if (path.StartsWith("data:", StringComparison.OrdinalIgnoreCase))
{
return new System.Windows.Media.Imaging.BitmapImage(new Uri(path));
}
string pluginDirectory = values[1].ToString();
string fullPath = Path.Combine(pluginDirectory, path);
string ext = Path.GetExtension(path).ToLower();