1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Is it possible to get the scaling percentage of the screen resolution?

Discussão em 'Python' iniciado por Stack, Outubro 5, 2024 às 21:32.

  1. Stack

    Stack Membro Participativo

    I am trying to resize my window app according to the resolution. My computer resolution as we can see in the screenshot is 3840 x 2160 with a 300% scaling. With this code:

    from win32api import GetSystemMetrics
    import win32con

    print("Width =", GetSystemMetrics(win32con.SM_CXVIRTUALSCREEN))
    print("Height =", GetSystemMetrics(win32con.SM_CYVIRTUALSCREEN))


    I get :

    Width = 1280
    Height = 720


    Because of the scaling

    [​IMG]

    Continue reading...

Compartilhe esta Página