[rtextures] Fix LoadImageFromScreen scaling (#3881)

This commit is contained in:
proberge-dev 2024-03-26 03:47:25 -04:00 committed by GitHub
parent 35252fceef
commit b905dafca0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);