From b905dafca038ca09e2b6d1e6eaf6f578b0bf0361 Mon Sep 17 00:00:00 2001 From: proberge-dev <87205407+proberge-dev@users.noreply.github.com> Date: Tue, 26 Mar 2024 03:47:25 -0400 Subject: [PATCH] [rtextures] Fix LoadImageFromScreen scaling (#3881) --- src/rtextures.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index 588c8b10..83216481 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -681,10 +681,11 @@ Image LoadImageFromTexture(Texture2D texture) // Load image from screen buffer and (screenshot) Image LoadImageFromScreen(void) { + Vector2 scale = GetWindowScaleDPI(); Image image = { 0 }; - image.width = GetScreenWidth(); - image.height = GetScreenHeight(); + image.width = GetScreenWidth()*scale.x; + image.height = GetScreenHeight()*scale.y; image.mipmaps = 1; image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; image.data = rlReadScreenPixels(image.width, image.height);