Browse Source

Update RenderTargetBitmap.cs

pull/12793/head
Paisley Mahern 3 years ago
committed by GitHub
parent
commit
59d14ddcea
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/Avalonia.Base/Media/Imaging/RenderTargetBitmap.cs

13
src/Avalonia.Base/Media/Imaging/RenderTargetBitmap.cs

@ -68,19 +68,18 @@ namespace Avalonia.Media.Imaging
/// </summary>
/// <returns>The drawing context.</returns>
public DrawingContext CreateDrawingContext()
{
var platform = PlatformImpl.Item.CreateDrawingContext();
platform.Clear(Colors.Transparent);
return new PlatformDrawingContext(platform);
}
=> CreateDrawingContext(true);
/// <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>
/// <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>
public DrawingContext CreateEditDrawingContext()
public DrawingContext CreateDrawingContext(bool clear)
{
var platform = PlatformImpl.Item.CreateDrawingContext();
if(clear)
platform.Clear(Colors.Transparent);
return new PlatformDrawingContext(platform);
}

Loading…
Cancel
Save