ConvertSolidColorBrush() 공개 정적인 메소드

Converts the SolidColorBrush.
public static ConvertSolidColorBrush ( Color color ) : SlimDX.Direct2D.Brush
color System.Drawing.Color The Color.
리턴 SlimDX.Direct2D.Brush
예제 #1
0
        /// <summary>
        /// Draws a string.
        /// </summary>
        /// <param name="text">The Text.</param>
        /// <param name="font">The Font.</param>
        /// <param name="rectangle">The Rectangle.</param>
        /// <param name="color">The Color.</param>
        public void DrawString(string text, Font font, Rectangle rectangle, Color color)
        {
            var dxFont = font.Instance as DirectXFont;

            if (dxFont == null)
            {
                throw new ArgumentException("DirectX10 expects a DirectXFont as resource.");
            }

            _renderTarget.DrawText(text, dxFont.GetFont(),
                                   new RectangleF(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height),
                                   DirectXHelper.ConvertSolidColorBrush(color));
        }
예제 #2
0
        /// <summary>
        /// Draws a string.
        /// </summary>
        /// <param name="text">The Text.</param>
        /// <param name="font">The Font.</param>
        /// <param name="position">The Position.</param>
        /// <param name="color">The Color.</param>
        public void DrawString(string text, Font font, Vector2 position, Color color)
        {
            var dxFont = font.Instance as DirectXFont;

            if (dxFont == null)
            {
                throw new ArgumentException("DirectX10 expects a DirectXFont as resource.");
            }

            _renderTarget.DrawText(text, dxFont.GetFont(),
                                   new RectangleF(position.X, position.Y, 9999, 9999), DirectXHelper.ConvertSolidColorBrush(color));
        }