Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

Added new optional parameter "quality" for IBitmap and IBitmapImpl.Save method

Open llfab opened this issue 2 years ago • 6 comments

What does the pull request do?

This change allows for an optional quality parameter for saving Bitmap to a png file or stream. The parameter is interpreted by the backend implementations but typically ranges from 0..100. The parameter comes with a default value (null) which preserves the current behavior and is compatible with the current use.

What is the current behavior?

Bitmaps can only be stored with default quality.

What is the updated/expected behavior with this PR?

Bitmap.Save() can be used with and without quality parameter

How was the solution implemented (if it's not obvious)?

Changed interfaces IBitmap and IBitmapImpl to support the additional but optional parameter

Checklist

  • [x] Added unit tests (if possible)? => unit tests already there
  • [x] Added XML documentation to any related classes?
  • [ ] Consider submitting a PR to https://github.com/AvaloniaUI/Documentation with user documentation

Breaking changes

  • changed interface IBitmap
  • changed interface IBitmapImpl

Both are extended in a compatible manner.

Obsoletions / Deprecations

n/a

Fixed issues

n/a

llfab avatar Oct 05 '22 17:10 llfab

CLA assistant check
All CLA requirements met.

dnfadmin avatar Oct 05 '22 17:10 dnfadmin

You can test this PR using the following package version. 11.0.999-cibuild0024334-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

avaloniaui-team avatar Oct 05 '22 18:10 avaloniaui-team

You can test this PR using the following package version. 11.0.999-cibuild0024516-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

avaloniaui-team avatar Oct 10 '22 19:10 avaloniaui-team

You can test this PR using the following package version. 11.0.999-cibuild0025081-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

avaloniaui-team avatar Oct 19 '22 21:10 avaloniaui-team

You can test this PR using the following package version. 11.0.999-cibuild0025541-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

avaloniaui-team avatar Oct 31 '22 14:10 avaloniaui-team

You can test this PR using the following package version. 11.0.999-cibuild0025611-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

avaloniaui-team avatar Nov 02 '22 08:11 avaloniaui-team

You can test this PR using the following package version. 11.0.999-cibuild0025681-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

avaloniaui-team avatar Nov 02 '22 22:11 avaloniaui-team