FModel v4.4.4
Some checks failed
FModel QA Builder / build (push) Has been cancelled

This commit is contained in:
Asval
2024-10-20 21:11:17 +02:00
parent f266cd4c34
commit c6c8cf201e
8 changed files with 91 additions and 9 deletions

View File

@@ -68,9 +68,13 @@ public class TabImage : ViewModel
Image = null;
return;
}
_bmp = bitmap;
using var data = _bmp.Encode(NoAlpha ? ETextureFormat.Jpeg : UserSettings.Default.TextureExportFormat, 100);
using var stream = new MemoryStream(ImageBuffer = data.ToArray(), false);
if (UserSettings.Default.TextureExportFormat == ETextureFormat.Tga)
return;
var image = new BitmapImage();
image.BeginInit();
image.CacheOption = BitmapCacheOption.OnLoad;
@@ -305,6 +309,7 @@ public class TabItem : ViewModel
var ext = UserSettings.Default.TextureExportFormat switch
{
ETextureFormat.Png => ".png",
ETextureFormat.Jpeg => ".jpg",
ETextureFormat.Tga => ".tga",
_ => ".png"
};