How get the screen mode/size?

Find quick help here to get you started with Hollywood
Post Reply
User avatar
Juan Carlos
Posts: 932
Joined: Mon Sep 06, 2010 1:02 pm

How get the screen mode/size?

Post 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?
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: How get the screen mode/size?

Post 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
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
Juan Carlos
Posts: 932
Joined: Mon Sep 06, 2010 1:02 pm

Re: How get the screen mode/size?

Post 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.
jalih
Posts: 280
Joined: Fri Jun 18, 2010 8:08 pm
Location: Finland

Re: How get the screen mode/size?

Post 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.
User avatar
Juan Carlos
Posts: 932
Joined: Mon Sep 06, 2010 1:02 pm

Re: How get the screen mode/size?

Post 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.
User avatar
Juan Carlos
Posts: 932
Joined: Mon Sep 06, 2010 1:02 pm

Re: How get the screen mode/size?

Post by Juan Carlos »

Thank you jalih for your help, the instructions work fine and I get the true screen size from my Workbench.
Post Reply