Page 1 of 1
How get the screen mode/size?
Posted: Tue May 08, 2012 1:07 pm
by Juan Carlos
How I can get the screen resolution, I have a little program of 320x290 to see pictures and I need know the true screen size in my system (1280x1024) because when I change the size display when the pictures are more big than my resolution Hollywood shows me an error message of it can't open this picture, my idea is to scale the picture depend of my screensize by % but the sizes that my program hadnle is the same 320x290, I used the trick of BGPic but it use the size from the program and with the desktop= true and change the size to my program, well, this trick isn't perfect, there is a single instruction to get the workbench or system screen mode?
Re: How get the screen mode/size?
Posted: Tue May 08, 2012 5:37 pm
by djrikki
A code snippet from Jack:
Code: Select all
Global application
application = {}
application.screenwidth = GetAttribute(#DISPLAY, 0, #ATTRHOSTWIDTH)
application.screenheight = GetAttribute(#DISPLAY, 0, #ATTRHOSTHEIGHT)
Local t = GetFileAttributes("PROGDIR:<executablefile>")
application.path = PathPart(t.path)
application.debug = False
application.debugtofile = False
application.version = "3.2.1"
application.platform = GetVersion().platform
Re: How get the screen mode/size?
Posted: Tue May 08, 2012 11:21 pm
by Juan Carlos
Thank you for your help but I don't understand your code, because it calls to other program, not with instructions inside the main code getting the screen size from your system.
Re: How get the screen mode/size?
Posted: Wed May 09, 2012 7:30 am
by jalih
Juan Carlos wrote:Thank you for your help but I don't understand your code, because it calls to other program, not with instructions inside the main code getting the screen size from your system.
No it's not...

djrikki is just filling a table with information...
Check GetAttribute() fuction usage part from his code, it's what you are after.
Re: How get the screen mode/size?
Posted: Wed May 09, 2012 11:08 pm
by Juan Carlos
jalih wrote:Juan Carlos wrote:Thank you for your help but I don't understand your code, because it calls to other program, not with instructions inside the main code getting the screen size from your system.
No it's not...

djrikki is just filling a table with information...
Check GetAttribute() fuction usage part from his code, it's what you are after.
Thank you for the clarification, this morning I tryed the GetDisplayModes() instruction as a little trick taking the last available display thinking in the people always select the last resolution the best for their monitors.
Again thanks.
Re: How get the screen mode/size?
Posted: Thu May 10, 2012 10:58 pm
by Juan Carlos
Thank you jalih for your help, the instructions work fine and I get the true screen size from my Workbench.