Paisley Mahern
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
7 deletions
-
src/Avalonia.Base/Media/Imaging/RenderTargetBitmap.cs
|
|
@ -68,19 +68,18 @@ namespace Avalonia.Media.Imaging |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <returns>The drawing context.</returns>
|
|
|
/// <returns>The drawing context.</returns>
|
|
|
public DrawingContext CreateDrawingContext() |
|
|
public DrawingContext CreateDrawingContext() |
|
|
{ |
|
|
=> CreateDrawingContext(true); |
|
|
var platform = PlatformImpl.Item.CreateDrawingContext(); |
|
|
|
|
|
platform.Clear(Colors.Transparent); |
|
|
|
|
|
return new PlatformDrawingContext(platform); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Creates a <see cref="DrawingContext"/> for editing the already existing image in the <see cref="RenderTargetBitmap"/>.
|
|
|
/// Creates a <see cref="DrawingContext"/> for drawing to the <see cref="RenderTargetBitmap"/>.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="clear">If true, clears the current image data to transparent, if false, leaves the image data unchanged.</param>
|
|
|
/// <returns>The drawing context.</returns>
|
|
|
/// <returns>The drawing context.</returns>
|
|
|
public DrawingContext CreateEditDrawingContext() |
|
|
public DrawingContext CreateDrawingContext(bool clear) |
|
|
{ |
|
|
{ |
|
|
var platform = PlatformImpl.Item.CreateDrawingContext(); |
|
|
var platform = PlatformImpl.Item.CreateDrawingContext(); |
|
|
|
|
|
if(clear) |
|
|
|
|
|
platform.Clear(Colors.Transparent); |
|
|
return new PlatformDrawingContext(platform); |
|
|
return new PlatformDrawingContext(platform); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|