Page 1 of 1
OpenScreen stretches images
Posted: Fri Sep 04, 2009 11:37 am
by V2
Hi,
I use OpenScreen with a resolution of 1024x768 to display an image. Everythink works as expected. But if I have a wide screen monitor connected, it stretched the image. How can I turn of this stretching feature so it displays the image in its original size?
Any hints?
Re: OpenScreen stretches images
Posted: Fri Sep 04, 2009 11:48 am
by UserOfPure
Are the screen dimensions still holding the values of 1024 and 768? If so, then it means the stretched image is because your monitor is stretching it for display, so you'll need to find a monitor setting that doesn't autofill the display. Because if you told OpenScreen to use 1024x768, then that's what it'll do, it doesn't autostretch.
Posted: Fri Sep 04, 2009 11:53 am
by V2
Thanks for the hint.
Is there an easy option/dialog for screen selection? Something pre-made which uses sth like ExamineScreenModes()?
Posted: Fri Sep 04, 2009 12:01 pm
by eesau
V2, there's an example of a screen mode requester in the example sources that come with PureBasic.
Posted: Fri Sep 04, 2009 12:01 pm
by V2
Ok - found my way around with ExamineDesktops().
Thanks for help!
Posted: Fri Sep 04, 2009 12:23 pm
by Trond
Whether the resolution is stretched or not depends on the graphics card and the monitor. If you graphics card doesn't take any special measures,, the monitor will stretch the image to fill the screen. NVidia cards have an option to not stretch in the nvidia control panel.
Posted: Fri Sep 04, 2009 2:09 pm
by Kaeru Gaman
Ok - found my way around with ExamineDesktops().
this is a good start, it helps you to decide whether the display is wide or not, and wich screenmodes to prefer.
the Include "Screen3DRequester.pb" in the Examples folder gives an impression how to examine the avaliable FullScreen modes.
a little Overview about how many screenmodes are possible gives this snippet:
Code: Select all
InitSprite()
n=0
If ExamineScreenModes()
While NextScreenMode()
Width = ScreenModeWidth()
Height = ScreenModeHeight()
Depth = ScreenModeDepth()
Rate = ScreenModeRefreshRate()
n+1
If rate = 60
out$ = RSet(Str(n),3,"0") + ": "
out$ + Str(Width) + "x" + Str(Height) + "-"
out$ + Str(Depth) + "bit @" + Str(Rate) + "Hz"
Debug out$
EndIf
Wend
Debug "Allover Number of Modes: "+Str(n)
Else
Debug "ExamineScreenModes failed!"
EndIf
... most of the testers had over a hundred modes avaliable, so it's highly recommended to put them in a LList and chose only really meaningful ones to offer the user.
... whether a 4:3 Mode is to displayed stretched or not is in the hand of the user, of your customer.
if you want it for yourself, as UserOfPure and Trond already said, find the settings for your GraCard-Moni-Combi to switch off the stretching.
I have one possibility directly in the HUD-Menu of the Monitor itself, and another approach in the nVidia-ControlCenter.
Posted: Fri Sep 04, 2009 3:49 pm
by Trond
... whether a 4:3 Mode is to displayed stretched or not is in the hand of the user, of your customer.
Not all graphics cards have a setting for this.
Posted: Fri Sep 04, 2009 8:58 pm
by V2
Take a peek at the result - it's a small game called:

>>
Memorizer, the brain game! (click me to download) <<
