Page 1 of 1

Screen Size

Posted: Fri Mar 07, 2025 9:41 pm
by matalog
I'm using DPI Aware in Compiling options. Then run this program:

Code: Select all

EnableExplicit
Enumeration
  #Window
  #TextGadget
  #StringGadget
EndEnumeration
CloseDebugOutput()
Procedure StringGadgetEvent()
 ExamineDesktops()
  SetGadgetText(#TextGadget,Str(DesktopWidth(0))+" x "+Str(DesktopHeight(0)))
  
EndProcedure
    OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 400, 600, "", #PB_Window_ScreenCentered|#PB_Window_BorderLess)
        LoadFont(0, "Arial", 16)
TextGadget(#TextGadget, 10, 110, 250, 50,"", #PB_Text_Border)
StringGadget(#StringGadget, 10, 10, 250, 50, "")
SetGadgetFont(#TextGadget, FontID(0))
SetGadgetFont(#StringGadget, FontID(0))
BindGadgetEvent(#StringGadget, @StringGadgetEvent())
SetActiveGadget(#StringGadget)
It says 384 x 854. My phone is set to 1080x2400FHD+.

Am I limited to this resolution using SpiderBasic?

Re: Screen Size

Posted: Sat Mar 08, 2025 11:57 am
by Caronte3D
No limitation.
Use and run in the phone:

Code: Select all

SetGadgetText(#TextGadget,Str(DesktopScaledX(DesktopWidth(0)))+" x "+Str(DesktopScaledY(DesktopHeight(0))))
Why do you want pixel values? This way only will show ok on your device and the ones with the same resolution as yours.