Scale imported raw data
This commit is contained in:
parent
495b4ffedd
commit
e2788e483e
@ -116,13 +116,18 @@ int main(int argc, char *argv[0])
|
|||||||
|
|
||||||
showImportPanel = false;
|
showImportPanel = false;
|
||||||
btnLoadPressed = false;
|
btnLoadPressed = false;
|
||||||
|
|
||||||
|
if (texture.id > 0)
|
||||||
|
{
|
||||||
imageLoaded = true;
|
imageLoaded = true;
|
||||||
|
imageScale = 400.0f/texture.height;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imageLoaded)
|
if (imageLoaded)
|
||||||
{
|
{
|
||||||
// Image zoom control
|
// Image scale control
|
||||||
imageScale += (float)GetMouseWheelMove();
|
imageScale += (float)GetMouseWheelMove();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
@ -135,7 +140,12 @@ int main(int argc, char *argv[0])
|
|||||||
|
|
||||||
DrawRectangleLines(10, 10, SCREEN_WIDTH - 20, SCREEN_HEIGHT - 20, GuiLinesColor());
|
DrawRectangleLines(10, 10, SCREEN_WIDTH - 20, SCREEN_HEIGHT - 20, GuiLinesColor());
|
||||||
|
|
||||||
if (texture.id != 0) DrawTextureEx(texture, (Vector2){ SCREEN_WIDTH/2 - texture.width*imageScale/2, SCREEN_HEIGHT/2 - texture.height*imageScale/2 }, 0, imageScale, WHITE);
|
if (texture.id != 0)
|
||||||
|
{
|
||||||
|
DrawTextureEx(texture, (Vector2){ SCREEN_WIDTH/2 - texture.width*imageScale/2, SCREEN_HEIGHT/2 - texture.height*imageScale/2 }, 0, imageScale, WHITE);
|
||||||
|
DrawText(FormatText("SCALE x%.0f", imageScale), 20, SCREEN_HEIGHT - 40, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
}
|
||||||
else DrawText("drag & drop RAW image file", 320, 180, 10, GRAY);
|
else DrawText("drag & drop RAW image file", 320, 180, 10, GRAY);
|
||||||
|
|
||||||
if (showImportPanel)
|
if (showImportPanel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user