Пример #1
0
        } // ButtonClose_Click

        #endregion

        #region Draw and Render

        /// <summary>
        /// Render the control to the main render target.
        /// </summary>
        internal override void DrawControlOntoMainTexture()
        {

            #region Shadow

            if (Visible && Shadow)
            {
                SkinControlInformation skinControlShadow = Skin.Controls[skinShadow];
                SkinLayer   skinLayerShadow   = skinControlShadow.Layers[layerShadow];

                Color shadowColor = Color.FromNonPremultiplied(skinLayerShadow.States.Enabled.Color.R, 
                                                               skinLayerShadow.States.Enabled.Color.G,
                                                               skinLayerShadow.States.Enabled.Color.B, Alpha);

                Renderer.Begin();
                    Renderer.DrawLayer(skinLayerShadow,
                                       new Rectangle(Left - skinControlShadow.OriginMargins.Left,
                                                     Top - skinControlShadow.OriginMargins.Top, 
                                                     Width + skinControlShadow.OriginMargins.Horizontal,
                                                     Height + skinControlShadow.OriginMargins.Vertical),
                                       shadowColor, 0);
                Renderer.End();
            }

            #endregion

            base.DrawControlOntoMainTexture();
        } // Render
        } // DrawToTexture

        /// <summary>
        /// Draws User Interface's render target to screen.
        /// </summary>
        public static void RenderUserInterfaceToScreen()
        {
            if (!Visible)
                return;
            if ((RootControls != null))
            {
                Renderer.Begin();
                Renderer.Draw(renderTarget.Resource, new Rectangle(0, 0, Screen.Width, Screen.Height), Color.White);
                Renderer.End();
            }
        } // DrawTextureToScreen