Exemple #1
0
 /// <summary>
 /// Draws the specified bitmap after scaling it to the size of the specified rectangle</summary>
 /// <param name="bmp">The bitmap to render</param>
 /// <param name="destRect">The size and position, in pixels, in the D2dGraphics's coordinate
 /// space, of the area in which the bitmap is drawn. If the rectangle is not well-ordered,
 /// nothing is drawn, but the D2dGraphics does not enter an error state.</param>
 /// <param name="opacity">A value between 0.0f and 1.0f, inclusive, that specifies an opacity value        
 /// to apply to the bitmap. This value is multiplied against the alpha values
 /// of the bitmap's contents.</param>
 /// <param name="interpolationMode">The interpolation mode to use if the bitmap is scaled or rotated 
 /// by the drawing operation</param>
 /// <param name="sourceRect">The size and position, in pixels in the bitmap's coordinate space, of the area
 /// within the bitmap to draw</param>
 public void DrawBitmap(D2dBitmap bmp, RectangleF destRect, float opacity,
     D2dBitmapInterpolationMode interpolationMode, RectangleF sourceRect)
 {
     m_renderTarget.DrawBitmap(bmp.NativeBitmap, destRect.ToSharpDX(), opacity,
         (BitmapInterpolationMode)interpolationMode, sourceRect.ToSharpDX());
 }
Exemple #2
0
        /// <summary>
        /// Draws the specified bitmap after scaling it to the size of the specified rectangle</summary>
        /// <param name="bmp">The bitmap to render</param>
        /// <param name="destRect">The size and position, in pixels, in the D2dGraphics's coordinate
        /// space, of the area in which the bitmap is drawn. If the rectangle is not well-ordered,
        /// nothing is drawn, but the D2dGraphics does not enter an error state.</param>
        /// <param name="opacity">A value between 0.0f and 1.0f, inclusive, that specifies an opacity value        
        /// to apply to the bitmap. This value is multiplied against the alpha values
        /// of the bitmap's contents.</param>
        /// <param name="interpolationMode">The interpolation mode to use if the bitmap is scaled or rotated 
        /// by the drawing operation</param>
        /// <param name="sourceRect">The size and position, in pixels in the bitmap's coordinate space, of the area
        /// within the bitmap to draw</param>
        public void DrawBitmap(D2dBitmap bmp, RectangleF destRect, float opacity, 
            D2dBitmapInterpolationMode interpolationMode, RectangleF sourceRect)
        {
            var drect = new SharpDX.RectangleF(destRect.X, destRect.Y, destRect.Right, destRect.Bottom);
            var srect = new SharpDX.RectangleF(sourceRect.X, sourceRect.Y, sourceRect.Right, sourceRect.Bottom);

            m_renderTarget.DrawBitmap(bmp.NativeBitmap, drect, opacity,
                (BitmapInterpolationMode)interpolationMode, srect);
        }
Exemple #3
0
 /// <summary>
 /// Draws the specified bitmap after scaling it to the size of the specifiedrectangle</summary>
 /// <param name="bmp">The bitmap to render</param>
 /// <param name="destRect">The size and position, in pixels, in the D2dGraphics's coordinate
 /// space, of the area in which the bitmap is drawn. If the rectangle is not well-ordered,
 /// nothing is drawn, but the D2dGraphics does not enter an error state.</param>
 /// <param name="opacity">A value between 0.0f and 1.0f, inclusive, that specifies an opacity value        
 /// to apply to the bitmap. This value is multiplied against the alpha values
 /// of the bitmap's contents.</param>
 /// <param name="interpolationMode">The interpolation mode to use if the bitmap is scaled or rotated 
 /// by the drawing operation</param>
 public void DrawBitmap(D2dBitmap bmp, RectangleF destRect, float opacity = 1.0f, D2dBitmapInterpolationMode interpolationMode = D2dBitmapInterpolationMode.Linear)
 {
     m_renderTarget.DrawBitmap(bmp.NativeBitmap, destRect.ToSharpDX(), opacity, (BitmapInterpolationMode)interpolationMode, null);
 }
Exemple #4
0
 /// <summary>
 /// Draws the specified bitmap after scaling it to the size of the specifiedrectangle</summary>
 /// <param name="bmp">The bitmap to render</param>
 /// <param name="destRect">The size and position, in pixels, in the D2dGraphics's coordinate
 /// space, of the area in which the bitmap is drawn. If the rectangle is not well-ordered,
 /// nothing is drawn, but the D2dGraphics does not enter an error state.</param>
 /// <param name="opacity">A value between 0.0f and 1.0f, inclusive, that specifies an opacity value        
 /// to apply to the bitmap. This value is multiplied against the alpha values
 /// of the bitmap's contents.</param>
 /// <param name="interpolationMode">The interpolation mode to use if the bitmap is scaled or rotated 
 /// by the drawing operation</param>
 public void DrawBitmap(D2dBitmap bmp, RectangleF destRect, float opacity = 1.0f, D2dBitmapInterpolationMode interpolationMode = D2dBitmapInterpolationMode.Linear)
 {
     var rect = new SharpDX.RectangleF(destRect.X, destRect.Y, destRect.Right, destRect.Bottom);
     m_renderTarget.DrawBitmap(bmp.NativeBitmap, rect, opacity, (BitmapInterpolationMode)interpolationMode, null);
 }