mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
BitmapInterpolationMode fixes
This commit is contained in:
parent
bf6674e44f
commit
f04d7cf897
@ -41,7 +41,6 @@ public class DeviceVisualizer : Control
|
||||
PropertyChanged += OnPropertyChanged;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Render(DrawingContext drawingContext)
|
||||
{
|
||||
@ -305,8 +304,9 @@ public class DeviceVisualizer : Control
|
||||
|
||||
using DrawingContext context = renderTargetBitmap.CreateDrawingContext();
|
||||
using Bitmap bitmap = new(device.Layout.Image.LocalPath);
|
||||
using Bitmap scaledBitmap = bitmap.CreateScaledBitmap(renderTargetBitmap.PixelSize);
|
||||
|
||||
context.DrawImage(bitmap, new Rect(bitmap.Size), new Rect(renderTargetBitmap.Size));
|
||||
context.DrawImage(scaledBitmap, new Rect(scaledBitmap.Size));
|
||||
lock (_deviceVisualizerLeds)
|
||||
{
|
||||
foreach (DeviceVisualizerLed deviceVisualizerLed in _deviceVisualizerLeds)
|
||||
|
||||
@ -46,10 +46,10 @@ internal class DeviceVisualizerLed
|
||||
try
|
||||
{
|
||||
using Bitmap bitmap = new(Led.Layout.Image.LocalPath);
|
||||
using Bitmap scaledBitmap = bitmap.CreateScaledBitmap(new PixelSize((Led.RgbLed.Size.Width * scale).RoundToInt(), (Led.RgbLed.Size.Height * scale).RoundToInt()));
|
||||
drawingContext.DrawImage(
|
||||
bitmap,
|
||||
new Rect(bitmap.Size),
|
||||
new Rect(Led.RgbLed.Location.X * scale, Led.RgbLed.Location.Y * scale, Led.RgbLed.Size.Width * scale, Led.RgbLed.Size.Height * scale)
|
||||
scaledBitmap,
|
||||
new Rect(Led.RgbLed.Location.X * scale, Led.RgbLed.Location.Y * scale, scaledBitmap.Size.Width, scaledBitmap.Size.Height)
|
||||
);
|
||||
}
|
||||
catch
|
||||
|
||||
@ -11,13 +11,14 @@
|
||||
x:Class="Artemis.UI.Screens.Device.DeviceSettingsView">
|
||||
<Border Classes="card" Padding="0" Width="200" ClipToBounds="True" Margin="5">
|
||||
<Grid RowDefinitions="140,*,Auto">
|
||||
<Rectangle Grid.Row="0" Fill="{DynamicResource CheckerboardBrush}"/>
|
||||
<shared:DeviceVisualizer VerticalAlignment="Center"
|
||||
<Rectangle Grid.Row="0" Fill="{DynamicResource CheckerboardBrush}" />
|
||||
<shared:DeviceVisualizer Grid.Row="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="5"
|
||||
ShowColors="False"
|
||||
Device="{CompiledBinding Device}"
|
||||
Grid.Row="0" />
|
||||
RenderOptions.BitmapInterpolationMode="HighQuality" />
|
||||
<Button Grid.Row="0"
|
||||
Classes="icon-button icon-button-large"
|
||||
VerticalAlignment="Bottom"
|
||||
@ -38,22 +39,22 @@
|
||||
<Grid Grid.Row="2" Margin="10" ColumnDefinitions="25,*">
|
||||
<CheckBox IsChecked="{CompiledBinding IsDeviceEnabled}" />
|
||||
|
||||
<SplitButton Grid.Column="1" Content="Properties" Command="{CompiledBinding ViewProperties}" HorizontalAlignment="Right">
|
||||
<SplitButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuItem Header="Open plugin directory" Command="{CompiledBinding OpenPluginDirectory}">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="FolderOpen" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Identity input" Command="{CompiledBinding DetectInput}">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="GestureDoubleTap" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<SplitButton Grid.Column="1" Content="Properties" Command="{CompiledBinding ViewProperties}" HorizontalAlignment="Right">
|
||||
<SplitButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuItem Header="Open plugin directory" Command="{CompiledBinding OpenPluginDirectory}">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="FolderOpen" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Identity input" Command="{CompiledBinding DetectInput}">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="GestureDoubleTap" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuFlyout>
|
||||
</SplitButton.Flyout>
|
||||
</SplitButton>
|
||||
</SplitButton.Flyout>
|
||||
</SplitButton>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
ExtendClientAreaTitleBarHeightHint="450">
|
||||
<Grid RowDefinitions="250,50,Auto,*" IsHitTestVisible="False">
|
||||
<Image Grid.Column="0" Stretch="Uniform" Width="200" Height="150" Source="/Assets/Images/Logo/bow.png" VerticalAlignment="Bottom"/>
|
||||
<Image Grid.Column="0" Stretch="Uniform" Width="200" Height="150" Source="/Assets/Images/Logo/bow.png" VerticalAlignment="Bottom" RenderOptions.BitmapInterpolationMode="HighQuality"/>
|
||||
<TextBlock Grid.Row="1"
|
||||
Classes="h5"
|
||||
HorizontalAlignment="Center"
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
|
||||
<shared:DeviceVisualizer Device="{CompiledBinding Device}" ShowColors="True" />
|
||||
<shared:DeviceVisualizer Device="{CompiledBinding Device}" ShowColors="True" RenderOptions.BitmapInterpolationMode="HighQuality"/>
|
||||
<Border x:Name="SurfaceDeviceBorder"
|
||||
Classes="selection-border"
|
||||
Classes.selected="{CompiledBinding IsSelected}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user