Skip to content

Commit 62a7772

Browse files
authored
Fix DPI
1 parent 45ce324 commit 62a7772

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

MiniLCDController/Form1.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ public byte[] byteTurn(byte[] buf)
9393
private void CaptureFrame()
9494
{
9595

96-
Bitmap bitmap = new Bitmap(160, 80, PixelFormat.Format16bppRgb565);
96+
Graphics g = Graphics.FromHwnd(IntPtr.Zero);
97+
float factor = g.DpiX / 96;
98+
99+
Bitmap bitmap = new Bitmap((int)(160* factor), (int)(80* factor), PixelFormat.Format16bppRgb565);
97100
Size size = bitmap.Size;
98101

99102
DateTime beforDT = System.DateTime.Now;

0 commit comments

Comments
 (0)