public void SetupSettings(TextureImporterSettings setting, bool setFormat = true)
        {
            if (setting.Format == SurfaceFormat.Invalid || SelectedIndex == -1)
            {
                return;
            }


            WidthLabel.Text  = $"Width: {setting.TexWidth}";
            HeightLabel.Text = $"Height: {setting.TexHeight}";

            if (Thread != null && Thread.IsAlive)
            {
                Thread.Abort();
            }

            if (formatComboBox.SelectedItem is SurfaceDim && setFormat)
            {
                setting.SurfaceDim = (SurfaceDim)formatComboBox.SelectedItem;
            }


            if (formatComboBox.SelectedItem is SurfaceFormat && setFormat)
            {
                setting.Format = (SurfaceFormat)formatComboBox.SelectedItem;

                listViewCustom1.Items[SelectedIndex].SubItems[1].Text = setting.Format.ToString();
            }

            if (setting.Format == SurfaceFormat.BC7_UNORM ||
                setting.Format == SurfaceFormat.BC7_SRGB)
            {
                compressionModeCB.Visible = true;
                compModeLbl.Visible       = true;
            }
            else
            {
                compressionModeCB.Visible = false;
                compModeLbl.Visible       = false;
            }

            if (setting.Format == SurfaceFormat.BC4_UNORM || setting.Format == SurfaceFormat.BC4_SNORM)
            {
                chkBC4Alpha.Enabled = true;
            }
            else
            {
                chkBC4Alpha.Enabled = false;
            }

            Bitmap bitmap = Toolbox.Library.Imaging.GetLoadingImage();

            if (compressionModeCB.SelectedIndex == 0)
            {
                CompressionMode = STCompressionMode.Fast;
            }
            else
            {
                CompressionMode = STCompressionMode.Normal;
            }

            Thread = new Thread((ThreadStart)(() =>
            {
                setting.IsFinishedCompressing = false;
                ToggleOkButton(false);

                pictureBox1.Image = bitmap;

                var mips = setting.GenerateMipList(CompressionMode, MultiThreading, chkBC4Alpha.Checked);

                setting.DataBlockOutput.Clear();
                setting.DataBlockOutput.Add(Utils.CombineByteArray(mips.ToArray()));

                ToggleOkButton(true);
                setting.IsFinishedCompressing = true;

                if (setting.DataBlockOutput.Count > 0)
                {
                    if (setting.Format == SurfaceFormat.BC5_SNORM)
                    {
                        bitmap = DDSCompressor.DecompressBC5(mips[0],
                                                             (int)setting.TexWidth, (int)setting.TexHeight, true);
                    }
                    else
                    {
                        bitmap = STGenericTexture.DecodeBlockGetBitmap(mips[0],
                                                                       setting.TexWidth, setting.TexHeight, TextureData.ConvertFormat(setting.Format), new byte[0]);
                    }

                    if (chkBC4Alpha.Checked)
                    {
                        bitmap = BitmapExtension.SetChannel(bitmap, STChannelType.Red,
                                                            STChannelType.Red, STChannelType.Red, STChannelType.Red);
                    }
                }

                if (pictureBox1.InvokeRequired)
                {
                    pictureBox1.Invoke((MethodInvoker) delegate {
                        pictureBox1.Image = bitmap;
                        pictureBox1.Refresh();

                        int size = Utils.GetSizeInBytes(mips);
                        dataSizeLbl.Text = $"Data Size: {STMath.GetFileSize(size, 5)}";
                    });
                }

                mips.Clear();
            }));
            Thread.Start();
        }