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.

DarkBASIC Professional Discussion / Anyway to stop DBP's automatic resizing of resolution with windows?

Author
Message
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 3rd Jul 2005 01:07
When you have a DBP program in windows mode (not fullscreen), and the resize the window, the screen resolution of the window is scaled to fit. Is there anyway to stop this?

Previously I have used set display mode to force a new screen resolution, this works but has two side effects. All media needs to be reloaded in and some graphic cards don't like certain screen resolutions causing the program to crash.

A good example of what I want is open MS Paint and switch between maximize and restore modes of the window and see what happens.

Also here are some screenshots of what I want


This is the original window.


This is what happens when the window is resized; the box has been resized as the screen has been scaled to fit.


This is what I want to happen, notice the box has stayed the same size as the first picture.

Heres the code for the above program to see for yourself



All suggestions are welcome.

Attachments

Login to view attachments
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 3rd Jul 2005 06:10
Annoying, especially when you're making an MP3 player or chat program.
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 3rd Jul 2005 06:25
do u have a problem with resizing!
Well do i have to the solution

with only 3 yes 3 easy payments of only $5 you too can stop dbp from doing that

lol i just cant resist

i got a dll with the magical command of 'make unresizable' and 'remove maximize'

attached is the dll just put it there like u would any other dll

currently not documented however

source code is available on request

Attachments

Login to view attachments
Keaz
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 3rd Jul 2005 09:05 Edited at: 3rd Jul 2005 09:07
I'm using BlueGUI to do what you want, but I am doing it the hardway(setting a new screen mode on resize of the window).

I'm only using the DBPro window as a child of another window for preview of an edited object.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 3rd Jul 2005 09:41
if u can get the handle of a bluegui window then i can make a little dll for u that will minimize that window

and also this should work on the parent window of the calling process(GetActiveWindow())

just try it at least who knows it might just work

pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 4th Jul 2005 05:30
Thanks for the posts.

@ Keaz

I use BlueGUI too, and the method that you said is what I currently use. However like I said its got side effects.

@ Offset of reality

Interesting and useful DLL, however I want the user to be able to maximize and resize the DBP window. I'm working on a 2D level editor and I need to be able switch between multiple programs at the same time, so resizing the window is a must. Also since I'm working with 2D, thats the reason why I need to stop DBP's automatic resizing, after all I can't have the 2D images being distorted.

Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 4th Jul 2005 05:32
well that i cant make in a dll sadly enough
if it was in 3-d u could scale the object i think to make it stay the same size but not shape

Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 4th Jul 2005 05:37
Use BlueGUI to get the desktop resolution and adjust the set camera aspect to keep it from distorting the objects/images.

pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 4th Jul 2005 05:43
Wow fast reply, actually thats not a bad idea, scaling the images might be an option. I still think I'll have a few problems with them displaying properly though, but it would better than what I've currently got - thanks.

Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Jul 2005 05:55
Seek and yee shall find

I had a similar problem a while ago and was forwarded to this snippet in the codebase.

It was written by 'the winch' and may be what you are looking for.


Keaz
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 4th Jul 2005 06:21 Edited at: 4th Jul 2005 06:31
@PizzaMan
I e-mailed you a copy of my current solution but you'll need BlueGUI 2 to compile it. It allows window resizing and keeps perspective (no squishy). It also has some work around and other bug fix code in case the user changes display modes.

P.S. My code always use a 4:3 ratio display mode. If my code doesn't work for what you need(as it does leave letterboxing to keep pespective). I know afew other ways that is more system intesive involving masking but they do work.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 4th Jul 2005 06:53
@ Scraggle

Quote: "Seek and yee shall find"


Very true, I did that a year ago when 'the winch' guided me to his code when I had this same problem. Its thanks to him I have what I have now. However I can't use this technique anymore because:

Quote: "All media needs to be reloaded in and some graphic cards don't like certain screen resolutions causing the program to crash."


@ Keaz

I've looked over your code, but I can't use it. You still use set display mode at unorthodox sizes, which means all media would have to be reloaded (not a big problem), however this also causes the program to crash on computers that have graphics cards that don't support unorthodox sizes.

Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 4th Jul 2005 08:03
use the standards
640x480x16(or32),800x600x16(or32),1024x768x16(or32) nothing lower(unless windowed) and nothing higher

pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 4th Jul 2005 08:23
@ Offset of reality

Thats simply not possible if you use the set display mode technique, as the technique requires unorthodox sizes to force the window to the correct resolution.

Keaz
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 4th Jul 2005 08:40
Unorthodox sizes are ok in windowed mode as the window is you display and the window can be any size. For an example of that check the file I attached to the e-mail.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Keaz
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 4th Jul 2005 08:42
Well then raise the system requirements.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Keaz
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 4th Jul 2005 08:47 Edited at: 4th Jul 2005 08:48
P.S. There is one other method. Set display mode to the user's desktop size then uses setGadgetShape to mask it to the window's client area size. You can use's a memblocked image to ajust the mask size. It's complex but it has the highest compatability and does what you need. I'm sorry but I don't have time to put together an example at the moment. Oh, well good luck. Now now display mode changes just larger and smaller viewing area. Excellent 2D solution but not for 3D.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 4th Jul 2005 08:53 Edited at: 4th Jul 2005 08:55
I could raise the system requirements, but I don't want to. The reason being the application doesn't need a great computer to run it, in fact it runs quite happily on a low spec sytem, so I don't see why I raise system requirements for something such as resizing a window with correct resolution.

Edit: Just saw your new post, thats not a bad idea I'll give it a try later on in the week.

Login to post a reply

Server time is: 2025-06-12 11:04:46
Your offset time is: 2025-06-12 11:04:46