mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Devices - Implemented device image loading
Devices - LED image loading WIP
This commit is contained in:
1 parent
e1121afdf9
commit
956ebd3313
13 files changed
+308
-107
No files matched your search
@@ -235,8 +235,8 @@ namespace Artemis.UI.Shared
|
||||
UpdateTransform();
|
||||
|
||||
// Load the device main image
|
||||
// if (Device.RgbDevice.DeviceInfo?.Image?.AbsolutePath != null && File.Exists(Device.RgbDevice.DeviceInfo.Image.AbsolutePath))
|
||||
// _deviceImage = new BitmapImage(Device.RgbDevice.DeviceInfo.Image);
|
||||
if (Device.Layout?.Image != null && File.Exists(Device.Layout.Image.LocalPath))
|
||||
_deviceImage = new BitmapImage(Device.Layout.Image);
|
||||
|
||||
// Create all the LEDs
|
||||
foreach (ArtemisLed artemisLed in Device.Leds)
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace Artemis.UI.Shared
|
||||
{
|
||||
internal class DeviceVisualizerLed
|
||||
{
|
||||
private SolidColorBrush? _renderColorBrush;
|
||||
|
||||
public DeviceVisualizerLed(ArtemisLed led)
|
||||
{
|
||||
Led = led;
|
||||
@@ -43,9 +45,9 @@ namespace Artemis.UI.Shared
|
||||
byte g = originalColor.GetG();
|
||||
byte b = originalColor.GetB();
|
||||
|
||||
drawingContext.DrawRectangle(isDimmed
|
||||
? new SolidColorBrush(Color.FromArgb(100, r, g, b))
|
||||
: new SolidColorBrush(Color.FromRgb(r, g, b)), null, LedRect);
|
||||
_renderColorBrush ??= new SolidColorBrush();
|
||||
_renderColorBrush.Color = isDimmed ? Color.FromArgb(100, r, g, b) : Color.FromRgb(r, g, b);
|
||||
drawingContext.DrawRectangle(_renderColorBrush, null, LedRect);
|
||||
}
|
||||
|
||||
public void RenderImage(DrawingContext drawingContext)
|
||||
|
||||
Reference in new issue
Block a user