OpenScreen stretches images

Just starting out? Need help? Post your questions and find answers here.
V2
User
User
Posts: 53
Joined: Wed Oct 15, 2003 4:53 pm

OpenScreen stretches images

Post 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?
V2
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: OpenScreen stretches images

Post 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.
V2
User
User
Posts: 53
Joined: Wed Oct 15, 2003 4:53 pm

Post by V2 »

Thanks for the hint.

Is there an easy option/dialog for screen selection? Something pre-made which uses sth like ExamineScreenModes()?
V2
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Post by eesau »

V2, there's an example of a screen mode requester in the example sources that come with PureBasic.
V2
User
User
Posts: 53
Joined: Wed Oct 15, 2003 4:53 pm

Post by V2 »

Ok - found my way around with ExamineDesktops().

Thanks for help!
V2
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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.
oh... and have a nice day.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
V2
User
User
Posts: 53
Joined: Wed Oct 15, 2003 4:53 pm

Post by V2 »

Take a peek at the result - it's a small game called:
Image
>> Memorizer, the brain game! (click me to download) <<

:D
V2
Post Reply