示例#1
0
        public Bitmap GetThumbnail(Bootstrap.Brush brush)
        {
            // get the diffuse image and use that to display the brush.
            Bitmap image     = null;
            string imageFile = brush.GetImageName(Bootstrap.Brush.Stage.Diffuse);

            // if there is no diffuse image, try to use the mask as our image.
            if (imageFile == "")
            {
                imageFile = brush.GetMaskName();
            }

            // now try to create a valid thumbnail.
            if (imageFile != "")
            {
                image = GetThumbnail(imageFile);
            }

            // if we couldn't find a decent thumbnail, give it an error
            // image.
            if (image == null)
            {
                image = GetErrorThumbnail();
            }

            return(image);
        }
示例#2
0
        void UpdateControls()
        {
            // enable or disable the stage buttons.
            foreach (Control control in pnControls.Controls)
            {
                if (control is Button)
                {
                    control.Enabled = (_brush != null);
                }
            }

            if (_brush == null)
            {
                return;
            }

            lbBrushName.Text = _brush.Name;
            UpdateButtonText(bnDiffuse, _brush.GetImageName(Bootstrap.Brush.Stage.Diffuse));
            UpdateButtonText(bnSpecular, _brush.GetImageName(Bootstrap.Brush.Stage.Specular));
            UpdateButtonText(bnNormal, _brush.GetImageName(Bootstrap.Brush.Stage.Normal));
            UpdateButtonText(bnBump, _brush.GetImageName(Bootstrap.Brush.Stage.Bump));
            UpdateButtonText(bnEmissive, _brush.GetImageName(Bootstrap.Brush.Stage.Emissive));
            UpdateButtonText(bnAmbient, _brush.GetImageName(Bootstrap.Brush.Stage.Ambient));
            UpdateButtonText(bnUser, _brush.GetImageName(Bootstrap.Brush.Stage.User));
            UpdateButtonText(bnMask, _brush.GetMaskName());
        }