(ded4a3e0a) v0.9.0.7

This commit is contained in:
Joonas Rikkonen
2019-06-25 16:00:44 +03:00
parent e5ae622c77
commit 4a51db77b5
1777 changed files with 421528 additions and 917 deletions
@@ -0,0 +1,45 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using Eto.Drawing;
using Eto.Wpf.Drawing;
using System.IO;
using System.Windows.Media.Imaging;
namespace MonoGame.Tools.Pipeline
{
static partial class Global
{
private static void PlatformInit()
{
}
private static System.Drawing.Bitmap PlatformGetFileIcon(string path)
{
return System.Drawing.Icon.ExtractAssociatedIcon(path).ToBitmap();
}
private static Bitmap ToEtoImage(System.Drawing.Bitmap bitmap)
{
var ret = new BitmapImage();
using (MemoryStream stream = new MemoryStream())
{
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
stream.Position = 0;
ret.BeginInit();
ret.DecodePixelHeight = 16;
ret.DecodePixelWidth = 16;
ret.StreamSource = stream;
ret.CacheOption = BitmapCacheOption.OnLoad;
ret.EndInit();
}
return new Bitmap(new BitmapHandler(ret));
}
}
}