private void ApplyEdit(Image Image) { STProgressBar progressBar = new STProgressBar(); progressBar.Task = "Applying Edits"; progressBar.Value = 0; progressBar.IsConstant = true; progressBar.StartPosition = FormStartPosition.CenterScreen; progressBar.Show(); progressBar.Refresh(); ActiveTexture.Width = (uint)Image.Width; ActiveTexture.Height = (uint)Image.Height; ActiveTexture.SetImageData(new Bitmap(Image), CurArrayDisplayLevel); CurMipDisplayLevel = 0; HasBeenEdited = false; if (ActiveTexture.EditedImages != null && ActiveTexture.EditedImages[CurArrayDisplayLevel] != null) { if (ActiveTexture.EditedImages[CurArrayDisplayLevel].bitmap != null) { ActiveTexture.EditedImages[CurArrayDisplayLevel].bitmap.Dispose(); } ActiveTexture.EditedImages[CurArrayDisplayLevel] = null; } progressBar.Value = 100; UpdateTextureReplace(new Bitmap(Image)); }
private void ApplyEdit() { STProgressBar progressBar = new STProgressBar(); progressBar.Task = "Applying Edits"; progressBar.Value = 0; progressBar.StartPosition = FormStartPosition.CenterScreen; progressBar.Show(); progressBar.Refresh(); Image Image = pictureBoxCustom1.Image; if (Image != null) { ActiveTexture.Width = (uint)Image.Width; ActiveTexture.Height = (uint)Image.Height; ActiveTexture.SetImageData(new Bitmap(Image), CurArrayDisplayLevel); CurMipDisplayLevel = 0; HasBeenEdited = false; } ActiveTexture.EditedImages[CurArrayDisplayLevel].bitmap.Dispose(); ActiveTexture.EditedImages[CurArrayDisplayLevel] = null; progressBar.Value = 100; }