/// <summary> /// Draws the specified bitmap after scaling it to the size of the specified rectangle. /// </summary> /// <param name="bitmap">The <see cref="ID2D1Bitmap"/> to render.</param> /// <param name="destinationRectangle">The size and position, in device-independent pixels in the render target's coordinate space, of the area to which the bitmap is drawn; If the rectangle is specified but not well-ordered, nothing is drawn, but the render target 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. The default value is 1.0f. </param> /// <param name="interpolationMode">The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation. The default value is <see cref="F:Vortice.Direct2D1.BitmapInterpolationMode.Linear" />. </param> /// <param name="sourceRectangle">The size and position, in device-independent pixels in the bitmap's coordinate space, of the area within the bitmap to be drawn; NULL to draw the entire bitmap. </param> public void DrawBitmap(ID2D1Bitmap bitmap, RectangleF destinationRectangle, float opacity, BitmapInterpolationMode interpolationMode, RectangleF sourceRectangle) { RawRectF rawDestinationRectangle = destinationRectangle; RawRectF rawSourceRectangle = sourceRectangle; DrawBitmap(bitmap, (RawRectF?)rawDestinationRectangle, opacity, interpolationMode, rawSourceRectangle); }
public ID2D1RectangleGeometry CreateRectangleGeometry(RectangleF rectangle) { unsafe { RawRectF rawRect = rectangle; return(CreateRectangleGeometry(new IntPtr(&rawRect))); } }
/// <summary> /// Initializes a new instance of the <see cref="RoundedRectangle"/> struct. /// </summary> /// <param name="rect">The coordinates of the rectangle.</param> /// <param name="radiusX">The x-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.</param> /// <param name="radiusY">The y-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.</param> public RoundedRectangle(RawRectF rect, float radiusX, float radiusY) { Rect = rect; RadiusX = radiusX; RadiusY = radiusY; }
/// <summary> /// Draws the specified bitmap after scaling it to the size of the specified rectangle. /// </summary> /// <param name="bitmap">The <see cref="ID2D1Bitmap"/> to render.</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. The default value is 1.0f. </param> /// <param name="interpolationMode">The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation. The default value is <see cref="F:SharpDX.Direct2D1.BitmapInterpolationMode.Linear" />. </param> /// <param name="sourceRectangle">The size and position, in device-independent pixels in the bitmap's coordinate space, of the area within the bitmap to be drawn; NULL to draw the entire bitmap. </param> public void DrawBitmap(ID2D1Bitmap bitmap, float opacity, BitmapInterpolationMode interpolationMode, RectangleF sourceRectangle) { RawRectF rawRect = sourceRectangle; DrawBitmap(bitmap, null, opacity, interpolationMode, rawRect); }
public unsafe ID2D1RectangleGeometry CreateRectangleGeometry(RawRectF rectangle) { return(CreateRectangleGeometry(new IntPtr(&rectangle))); }