public void SetupSettings() { if (SelectedTexSettings.Format == SurfaceFormat.Invalid) { return; } WidthLabel.Text = $"Width {SelectedTexSettings.TexWidth}"; HeightLabel.Text = $"Height {SelectedTexSettings.TexHeight}"; if (formatComboBox.SelectedItem is SurfaceFormat) { SelectedTexSettings.Format = (SurfaceFormat)formatComboBox.SelectedItem; listViewCustom1.SelectedItems[0].SubItems[1].Text = SelectedTexSettings.Format.ToString(); } Bitmap bitmap = Switch_Toolbox.Library.Imaging.GetLoadingImage(); Thread = new Thread((ThreadStart)(() => { ToggleOkButton(false); pictureBox1.Image = bitmap; SelectedTexSettings.Compress(); ToggleOkButton(true); if (SelectedTexSettings.Format == SurfaceFormat.BC5_SNORM) { bitmap = DDSCompressor.DecompressBC5(SelectedTexSettings.DataBlockOutput[0], (int)SelectedTexSettings.TexWidth, (int)SelectedTexSettings.TexHeight, true); } else { bitmap = TextureData.DecodeBlockGetBitmap(SelectedTexSettings.DataBlockOutput[0], SelectedTexSettings.TexWidth, SelectedTexSettings.TexHeight, TextureData.ConvertFormat(SelectedTexSettings.Format)); } if (pictureBox1.InvokeRequired) { pictureBox1.Invoke((MethodInvoker) delegate { pictureBox1.Image = bitmap; pictureBox1.Refresh(); }); } })); Thread.Start(); }