mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Fixed debug display (resolves #4) and fixed volume display scaling
This commit is contained in:
parent
c2c002715c
commit
c801656b00
@ -1,5 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
@ -82,33 +84,19 @@ namespace Artemis.Modules.Effects.Debug
|
|||||||
|
|
||||||
public void Handle(ChangeBitmap message)
|
public void Handle(ChangeBitmap message)
|
||||||
{
|
{
|
||||||
//// Doesn't show transparancy
|
// Doesn't show transparancy
|
||||||
//using (var memory = new MemoryStream())
|
using (var memory = new MemoryStream())
|
||||||
//{
|
|
||||||
// message.Bitmap.Save(memory, ImageFormat.Bmp);
|
|
||||||
// memory.Position = 0;
|
|
||||||
|
|
||||||
// var bitmapImage = new BitmapImage();
|
|
||||||
// bitmapImage.BeginInit();
|
|
||||||
// bitmapImage.StreamSource = memory;
|
|
||||||
// bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
|
|
||||||
// bitmapImage.EndInit();
|
|
||||||
|
|
||||||
// ImageSource = bitmapImage;
|
|
||||||
//}
|
|
||||||
|
|
||||||
// Causes "Generic GDI+ Exception" after a while
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
ImageSource = Imaging.CreateBitmapSourceFromHBitmap(
|
message.Bitmap.Save(memory, ImageFormat.Png);
|
||||||
message.Bitmap.GetHbitmap(),
|
memory.Position = 0;
|
||||||
IntPtr.Zero,
|
|
||||||
Int32Rect.Empty,
|
var bitmapImage = new BitmapImage();
|
||||||
BitmapSizeOptions.FromEmptyOptions());
|
bitmapImage.BeginInit();
|
||||||
}
|
bitmapImage.StreamSource = memory;
|
||||||
catch (Exception)
|
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
|
||||||
{
|
bitmapImage.EndInit();
|
||||||
// ignored
|
|
||||||
|
ImageSource = bitmapImage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
|
|||||||
},
|
},
|
||||||
LinearGradientMode.Horizontal)
|
LinearGradientMode.Horizontal)
|
||||||
{
|
{
|
||||||
Width = (int) (100.00/(MainModel.ActiveKeyboard.Width*4)*Volume),
|
Width = (int) ((MainModel.ActiveKeyboard.Width/100.00)*Volume)*Scale,
|
||||||
ContainedBrush = false
|
ContainedBrush = false
|
||||||
};
|
};
|
||||||
volumeRect.Draw(g);
|
volumeRect.Draw(g);
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user