Browse Source
`IImage` represents a base interface for raster and vector images. `IBitmap` now implements this interface and `DrawingContext` accepts this interface in `DrawImage`. The interface defines a `Draw` method which introduces a level of indirection for drawing the image through the image itself. Renamed `IDrawingContextImpl.DrawImage` to `DrawBitmap` as this only handles drawing bitmap images. `Bitmap` now calls this method directly on the platform implementation.pull/3378/head
15 changed files with 76 additions and 33 deletions
@ -0,0 +1,31 @@ |
|||
using Avalonia.Platform; |
|||
using Avalonia.Visuals.Media.Imaging; |
|||
|
|||
namespace Avalonia.Media |
|||
{ |
|||
/// <summary>
|
|||
/// Represents a raster or vector image.
|
|||
/// </summary>
|
|||
public interface IImage |
|||
{ |
|||
/// <summary>
|
|||
/// Gets the size of the image, in device independent pixels.
|
|||
/// </summary>
|
|||
Size Size { get; } |
|||
|
|||
/// <summary>
|
|||
/// Draws the image to a <see cref="DrawingContext"/>.
|
|||
/// </summary>
|
|||
/// <param name="context">The drawing context.</param>
|
|||
/// <param name="opacity">The opacity to draw with.</param>
|
|||
/// <param name="sourceRect">The rect in the image to draw.</param>
|
|||
/// <param name="destRect">The rect in the output to draw to.</param>
|
|||
/// <param name="bitmapInterpolationMode">The bitmap interpolation mode.</param>
|
|||
void Draw( |
|||
DrawingContext context, |
|||
double opacity, |
|||
Rect sourceRect, |
|||
Rect destRect, |
|||
BitmapInterpolationMode bitmapInterpolationMode); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue