Ambient 1 zone improve (#1635)

* ....

* Amvietn: improved color for 1-zone
This commit is contained in:
DLdota
2023-11-22 21:51:11 +02:00
committed by GitHub
parent 1d2f1d3bb2
commit 4e46a20eff

View File

@@ -627,14 +627,13 @@ namespace GHelper.USB
bound.Y += bound.Height / 3;
bound.Height -= (int)Math.Round(bound.Height * (0.33f + 0.022f)); // cut 1/3 of the top screen + windows panel
Bitmap screen_low;
Bitmap screen_low = screen_low = AmbientData.CamptureScreen(bound, 512, 288); //quality decreases greatly if it is less 512 ;
Bitmap screeb_pxl;
int zones = AURA_ZONES;
if (isStrix) // laptop with lightbar
{
screen_low = AmbientData.CamptureScreen(bound, 512, 288); //quality decreases greatly if it is less 512
screeb_pxl = AmbientData.ResizeImage(screen_low, 4, 2); // 4x2 zone. top for keyboard and bot for lightbar
var mid_left = ColorUtils.GetMidColor(screeb_pxl.GetPixel(0, 1), screeb_pxl.GetPixel(1, 1));
var mid_right = ColorUtils.GetMidColor(screeb_pxl.GetPixel(2, 1), screeb_pxl.GetPixel(3, 1));
@@ -650,7 +649,6 @@ namespace GHelper.USB
else
{
zones = 1;
screen_low = AmbientData.CamptureScreen(bound, 256, 144);
screeb_pxl = AmbientData.ResizeImage(screen_low, 1, 1);
AmbientData.Colors[0].RGB = ColorUtils.HSV.UpSaturation(screeb_pxl.GetPixel(0, 0), (float)0.3);
}