16:10 high dpi #373

This commit is contained in:
辉鸭蛋 2024-05-12 00:28:37 +08:00
parent 85e0c827ca
commit c27b5176e7
3 changed files with 5 additions and 3 deletions

View File

@ -9,5 +9,6 @@ public class ScaleConverter(double scale) : INodeConverter
public (int x, int y, int w, int h) ToPrev(int x, int y, int w, int h)
{
return ((int)(x * scale), (int)(y * scale), (int)(w * scale), (int)(h * scale));
// return (x, y, (int)(w * scale), (int)(h * scale));
}
}

View File

@ -69,11 +69,12 @@ public class GameCaptureRegion(Bitmap bitmap, int initX, int initY, Region? owne
var scale = Width / 1920d;
var newMat = new Mat();
Cv2.Resize(SrcMat, newMat, new Size(1920, Height * scale));
Cv2.Resize(SrcMat, newMat, new Size(1920, Height / scale));
_srcGreyMat?.Dispose();
_srcMat?.Dispose();
_srcBitmap?.Dispose();
return new ImageRegion(newMat, X, Y, this, new ScaleConverter(scale));
return new ImageRegion(newMat, 0, 0, this, new ScaleConverter(scale));
// return new ImageRegion(newMat, 0, 0, this, new TranslationConverter(0, 0));
}
/// <summary>

View File

@ -92,7 +92,7 @@ namespace BetterGenshinImpact.GameTask.Model
if (CaptureAreaRect.Width > 1920)
{
var scale = CaptureAreaRect.Width / 1920d;
ScaleMax1080PCaptureRect = new Rect(CaptureAreaRect.X, CaptureAreaRect.Y, 1920, (int)(CaptureAreaRect.Height * scale));
ScaleMax1080PCaptureRect = new Rect(CaptureAreaRect.X, CaptureAreaRect.Y, 1920, (int)(CaptureAreaRect.Height / scale));
}
else
{