committed by
GitHub
17 changed files with 244 additions and 48 deletions
@ -0,0 +1,31 @@ |
|||||
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
||||
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
|
namespace Avalonia.Visuals.Media.Imaging |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Controls the performance and quality of bitmap scaling.
|
||||
|
/// </summary>
|
||||
|
public enum BitmapInterpolationMode |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Uses the default behavior of the underling render backend.
|
||||
|
/// </summary>
|
||||
|
Default, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// The best performance but worst image quality.
|
||||
|
/// </summary>
|
||||
|
LowQuality, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Good performance and decent image quality.
|
||||
|
/// </summary>
|
||||
|
MediumQuality, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Highest quality but worst performance.
|
||||
|
/// </summary>
|
||||
|
HighQuality |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
||||
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
|
using Avalonia.Visuals.Media.Imaging; |
||||
|
|
||||
|
namespace Avalonia.Media |
||||
|
{ |
||||
|
public class RenderOptions |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Defines the <see cref="BitmapInterpolationMode"/> property.
|
||||
|
/// </summary>
|
||||
|
public static readonly StyledProperty<BitmapInterpolationMode> BitmapInterpolationModeProperty = |
||||
|
AvaloniaProperty.RegisterAttached<RenderOptions, AvaloniaObject, BitmapInterpolationMode>( |
||||
|
"BitmapInterpolationMode", |
||||
|
BitmapInterpolationMode.MediumQuality, |
||||
|
inherits: true); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets the value of the BitmapInterpolationMode attached property for a control.
|
||||
|
/// </summary>
|
||||
|
/// <param name="element">The control.</param>
|
||||
|
/// <returns>The control's left coordinate.</returns>
|
||||
|
public static BitmapInterpolationMode GetBitmapInterpolationMode(AvaloniaObject element) |
||||
|
{ |
||||
|
return element.GetValue(BitmapInterpolationModeProperty); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Sets the value of the BitmapInterpolationMode attached property for a control.
|
||||
|
/// </summary>
|
||||
|
/// <param name="element">The control.</param>
|
||||
|
/// <param name="value">The left value.</param>
|
||||
|
public static void SetBitmapInterpolationMode(AvaloniaObject element, BitmapInterpolationMode value) |
||||
|
{ |
||||
|
element.SetValue(BitmapInterpolationModeProperty, value); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue