From da46126e8b2b808910b3ae637f09a40eef4b2ee7 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Fri, 19 Jul 2019 15:27:30 -0400 Subject: [PATCH] Update image editor properly if edited --- Switch_Toolbox_Library/FileFormats/DDS.cs | 4 ++-- .../Forms/Editors/ImageEditor/ImageEditorBase.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Switch_Toolbox_Library/FileFormats/DDS.cs b/Switch_Toolbox_Library/FileFormats/DDS.cs index d19ce0cb..d8c2838f 100644 --- a/Switch_Toolbox_Library/FileFormats/DDS.cs +++ b/Switch_Toolbox_Library/FileFormats/DDS.cs @@ -30,7 +30,7 @@ namespace Toolbox.Library } } - public override bool CanEdit { get; set; } = false; + public override bool CanEdit { get; set; } = true; public bool CanSave { get; set; } = false; public bool FileIsEdited { get; set; } = false; @@ -786,7 +786,7 @@ namespace Toolbox.Library public override void SetImageData(Bitmap bitmap, int ArrayLevel) { - throw new NotImplementedException("Cannot set image data! Operation not implemented!"); + bdata = GenerateMipsAndCompress(bitmap, MipCount, Format); } //Todo create actual cube map conversion with Renderable Texture from generic one diff --git a/Switch_Toolbox_Library/Forms/Editors/ImageEditor/ImageEditorBase.cs b/Switch_Toolbox_Library/Forms/Editors/ImageEditor/ImageEditorBase.cs index 07f078ac..777613cd 100644 --- a/Switch_Toolbox_Library/Forms/Editors/ImageEditor/ImageEditorBase.cs +++ b/Switch_Toolbox_Library/Forms/Editors/ImageEditor/ImageEditorBase.cs @@ -728,6 +728,7 @@ namespace Toolbox.Library.Forms }; pictureBoxCustom1.Image = image; + pictureBoxCustom1.Refresh(); TotalMipCount = ActiveTexture.MipCount - 1; TotalArrayCount = ActiveTexture.ArrayCount - 1;