[GUI] Improve memory usage of image previews

- also a bit increased performance of alpha mask resizing for previews
This commit is contained in:
VaDiM
2023-03-12 03:17:31 +03:00
parent 01957a9443
commit 44a1240f5f
5 changed files with 32 additions and 36 deletions

View File

@ -231,10 +231,10 @@ namespace AssetStudioGUI
public static bool ExportSprite(AssetItem item, string exportPath)
{
var type = Properties.Settings.Default.convertType;
var alphaMask = Properties.Settings.Default.exportSpriteWithMask ? SpriteMaskMode.On : SpriteMaskMode.Off;
var spriteMaskMode = Properties.Settings.Default.exportSpriteWithMask ? SpriteMaskMode.Export : SpriteMaskMode.Off;
if (!TryExportFile(exportPath, item, "." + type.ToString().ToLower(), out var exportFullPath))
return false;
var image = ((Sprite)item.Asset).GetImage(alphaMask);
var image = ((Sprite)item.Asset).GetImage(spriteMaskMode: spriteMaskMode);
if (image != null)
{
using (image)