AlbedoDatabaseGenerator.Database.Manifest.LoadTextures C# (CSharp) Метод

LoadTextures() публичный Метод

Loads the textures described by the manifest
public LoadTextures ( ) : void
Результат void
            public void LoadTextures()
            {
                if ( m_Texture == null )
                    m_Texture = Bitmap.FromFile( GetFullPath( m_CalibratedTextureFileName ) ) as Bitmap;

                m_SwatchMin.LoadTexture( this );
                m_SwatchMax.LoadTexture( this );
                m_SwatchAvg.LoadTexture( this );
                foreach ( Swatch CS in m_CustomSwatches )
                    CS.LoadTexture( this );
            }

Usage Example

Пример #1
0
        private void    UpdateUIFromEntry(Database.Entry _Entry)
        {
            textBoxRelativePath.Text       = _Entry != null ? _Entry.RelativePath : "";
            textBoxFriendlyName.Text       = _Entry != null ? _Entry.FriendlyName : "";
            textBoxDescription.Text        = _Entry != null ? _Entry.Description : "";
            textBoxOverviewImage.Text      = _Entry != null && _Entry.OverviewImageFileName != null ? _Entry.OverviewImageFileName.FullName : "";
            panelOverviewImage.SourceImage = _Entry != null ? _Entry.OverviewImage : null;
            panelThumbnail.SourceImage     = _Entry != null ? _Entry.Thumbnail : null;

            UpdateTagsUIFromEntry(_Entry);

            Database.Manifest M = _Entry != null ? _Entry.Manifest : null;
            if (M != null)
            {
                M.LoadTextures();                       // Make sure textures are ready
            }
            panelSwatchMin.BackColor = M != null ? M.m_SwatchMin.Color : BackColor;
            panelSwatchMax.BackColor = M != null ? M.m_SwatchMax.Color : BackColor;
            panelSwatchAvg.BackColor = M != null ? M.m_SwatchAvg.Color : BackColor;

            Panel[] CustomSwatchPanels = new Panel[] {
                panelCS0,
                panelCS1,
                panelCS2,
                panelCS3,
                panelCS4,
                panelCS5,
                panelCS6,
                panelCS7,
                panelCS8,
            };
            for (int i = 0; i < CustomSwatchPanels.Length; i++)
            {
                bool Available = M != null && i < M.m_CustomSwatches.Length;
                CustomSwatchPanels[i].BackColor = Available ? M.m_CustomSwatches[i].Color : BackColor;
                panelTexture.CustomSwatches[i]  = Available ? new WMath.Vector4D(M.m_CustomSwatches[i].m_LocationTopLeft.x, M.m_CustomSwatches[i].m_LocationTopLeft.y, M.m_CustomSwatches[i].m_LocationBottomRight.x, M.m_CustomSwatches[i].m_LocationBottomRight.y) : null;
            }

            panelTexture.SourceImage = M != null ? M.m_Texture : null;
        }