mirror of
https://github.com/babalae/better-genshin-impact
synced 2025-01-09 04:19:47 +08:00
16:10 high dpi #373
This commit is contained in:
parent
85e0c827ca
commit
c27b5176e7
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user