예제 #1
0
        private void UpdateMipDisplay()
        {
            mipLevelCounterLabel.Text   = $"{CurMipDisplayLevel} / {textureData.mipmaps[CurArrayDisplayLevel].Count - 1}";
            arrayLevelCounterLabel.Text = $"{CurArrayDisplayLevel} / {textureData.mipmaps.Count - 1}";


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

            Thread = new Thread((ThreadStart)(() =>
            {
                pictureBoxCustom1.Image = Imaging.GetLoadingImage();
                pictureBoxCustom1.Image = textureData.DisplayTexture(CurMipDisplayLevel, CurArrayDisplayLevel);

                //  texSizeMipsLabel.Text = $"Width = {pictureBoxCustom1.Image.Width} Height = {pictureBoxCustom1.Image.Height}";
            }));
            Thread.Start();


            if (CurMipDisplayLevel != textureData.mipmaps[CurArrayDisplayLevel].Count - 1)
            {
                BtnMipsRight.Enabled = true;
            }
            else
            {
                BtnMipsRight.Enabled = false;
            }

            if (CurMipDisplayLevel != 0)
            {
                BtmMipsLeft.Enabled = true;
            }
            else
            {
                BtmMipsLeft.Enabled = false;
            }

            if (CurArrayDisplayLevel != textureData.mipmaps.Count - 1)
            {
                btnRightArray.Enabled = true;
            }
            else
            {
                btnRightArray.Enabled = false;
            }

            if (CurArrayDisplayLevel != 0)
            {
                btnLeftArray.Enabled = true;
            }
            else
            {
                btnLeftArray.Enabled = false;
            }
        }
예제 #2
0
        private void LoadImage()
        {
            if (Thread != null && Thread.IsAlive)
            {
                Thread.Abort();
            }

            Thread = new Thread((ThreadStart)(() =>
            {
                pictureBoxCustom1.Image = Imaging.GetLoadingImage();
                pictureBoxCustom1.Image = textureData.DisplayTexture(CurMipDisplayLevel, CurArrayDisplayLevel);
            }));
            Thread.Start();

            GC.Collect();
        }
예제 #3
0
        private void DisplayTexture(TextureData texData)
        {
            if (Thread != null && Thread.IsAlive)
            {
                Thread.Abort();
            }


            Thread = new Thread((ThreadStart)(() =>
            {
                pictureBoxCustom1.Image = Switch_Toolbox.Library.Imaging.GetLoadingImage();
                pictureBoxCustom1.Image = texData.DisplayTexture();
                //  texSizeMipsLabel.Text = $"Width = {pictureBoxCustom1.Image.Width} Height = {pictureBoxCustom1.Image.Height}";
            }));
            Thread.Start();
        }