ConvertRectangle() 정적인 개인적인 메소드

Converts the Rectangle.
static private ConvertRectangle ( Math rectangle ) : Rectangle
rectangle Math The Rectangle.
리턴 System.Drawing.Rectangle
예제 #1
0
        /// <summary>
        /// Draws a Rectangle.
        /// </summary>
        /// <param name="pen">The Pen.</param>
        /// <param name="rectangle">The Rectangle.</param>
        public void DrawRectangle(Pen pen, Rectangle rectangle)
        {
            var dxPen = pen.Instance as DirectXPen;

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

            _renderTarget.DrawRectangle(dxPen.GetPen(), DirectXHelper.ConvertRectangle(rectangle));
        }
예제 #2
0
        /// <summary>
        /// Draws a Texture.
        /// </summary>
        /// <param name="texture">The Texture.</param>
        /// <param name="rectangle">The Rectangle.</param>
        /// <param name="opacity">The Opacity.</param>
        /// <param name="color">The Color.</param>
        public void DrawTexture(Texture2D texture, Rectangle rectangle, Color color, float opacity = 1)
        {
            var dxTexture = texture as DirectXTexture;

            if (dxTexture == null)
            {
                throw new ArgumentException("DirectX10 expects a DirectXTexture as resource.");
            }
            Bitmap dxBmp = dxTexture.GetBitmap();

            _renderTarget.DrawBitmap(dxBmp, DirectXHelper.ConvertRectangle(rectangle), opacity,
                                     InterpolationMode == InterpolationMode.Linear
                    ? SlimDX.Direct2D.InterpolationMode.Linear
                    : SlimDX.Direct2D.InterpolationMode.NearestNeighbor);
        }
예제 #3
0
 /// <summary>
 /// Fills a Rectangle.
 /// </summary>
 /// <param name="color">The Color.</param>
 /// <param name="rectangle">The Rectangle.</param>
 public void FillRectangle(Color color, Rectangle rectangle)
 {
     _renderTarget.FillRectangle(new SolidColorBrush(_renderTarget, DirectXHelper.ConvertColor(color)),
                                 DirectXHelper.ConvertRectangle(rectangle));
 }