Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Screen Display Mode Function For DBC

Author
Message
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Dec 2006 18:36
This is a single function - SelectScreenMode() - which allows users to select the required screen mode from those available to them using the mouse.

Drop it into your program and call it with:

DisplayMode$=SelectScreenMode()

On exit from the function, the screen mode is already set and DisplayMode$ will contain the string returned from the perform checklist command (Eg: 800x600x32) which can be ignored if you have no use for it.

You could also put the function into it's own .DBA file and call it as a #Include file.

The following code is a 'paste into DBC and run' demo - just copy and paste the function itself into your own projects if it's of any use to you.



TDK_Man

Xenocythe
18
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 10th Dec 2006 20:48
Great work TDK! Looks like your back in buisness!

-Mansoor Siddiquie

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Dec 2006 13:34
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 13th Dec 2006 14:30
Cool, like it.

Any reason this won't run in DBP (or maybe there is an equiv. in DBP already)?

Cheers
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Dec 2006 15:39
No reason it shouldn't I guess - I've just not tested it in DBP.

TDK_Man

JosephB
17
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 13th Dec 2006 20:45
Seems to work fine in DBP. Very nice. Thank you.
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 14th Dec 2006 10:13 Edited at: 14th Dec 2006 10:15
Hi,

I tried it in DBP and it compiles and runs, but when I hover over anything from Column 3 I think, it breaks telling me its using an invalid string from the checklist.

I wonder if its because my card comes back with more choices, and its an uneven number also. I didn't get time to investigate it any further, sorry!

Edit: looking at your screenshot... I get 5 items per row, you seem to have many more. Bit more info also - rendering the possible resolutions appears to work fine, and the ones I can hover over safely can be clicked on and work great btw.

Cheers
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Dec 2006 13:49
Ah OK - I've just not error trapped it for users with less than the number of screen options I have - one of the reasons you let other users try it out for you!

That's a quick fix - hang on...

TDK_Man

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Dec 2006 14:24 Edited at: 14th Dec 2006 14:26
Here's the updated function demo.

I've now altered it for graphics cards that have different available screen options than mine and made it so you can now only select available screen modes.

At the same time I've also added a ScreenParams() array just to test that the set rez is what it should be on return from the function.

ScreenParams(0) = the screen width selected in the function
ScreenParams(1) = the screen height selected in the function
ScreenParams(2) = the screen bit depth selected in the function



TDK_Man

Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 15th Dec 2006 10:58
Cool, hopefully I'll get to test it out again later tonight - thanks.

Ps. one other DBP thing is I put a ,1 on the end of the get image command, this preserves a nice crisp image as default get image in DBP at least applies filters etc. which adds a blur.

Cheers

Login to post a reply

Server time is: 2024-05-03 12:21:30
Your offset time is: 2024-05-03 12:21:30