Loading ...
Sorry, an error occurred while loading the content.

Setting DisplayWidth and DisplayHeight

Expand Messages
  • titan2guy
    I am trying to use a LB program to drive a display projected on a screen. If the resolution is too high, the print is too fine and the audience cannot read
    Message 1 of 3 , Dec 1, 2008
    • 0 Attachment
      I am trying to use a LB program to drive a display projected on a
      screen. If the resolution is too high, the print is too fine and the
      audience cannot read it. (I've not found any way to change the font
      size in the "Notice", "Confirm", or "Prompt" displays.) Currently, I
      have my program look at DisplayWidth and DisplayHeight and if the they
      are too large, I provide directions on how to set the resolution &
      restart the program. On restart, if they reset the lower properly, that
      section is skipped. Is it possible in LB to set DisplayWidth and
      DisplayHeight? Ideally, I would like to save them & reset when the
      program is finishing to what they were when the program started.
      Thanks.
      TitanGuy


      [Non-text portions of this message have been removed]
    • Euan Turner
      ... I know this might not seem to helpful as I m not including any code, but I don t think it should be too difficult for you to implement a calculation that
      Message 2 of 3 , Dec 1, 2008
      • 0 Attachment
        --- In libertybasic@yahoogroups.com, "titan2guy" <kakeen@...> wrote:
        >
        > I am trying to use a LB program to drive a display projected on a
        > screen. If the resolution is too high, the print is too fine and the
        > audience cannot read it. (I've not found any way to change the font
        > size in the "Notice", "Confirm", or "Prompt" displays.) Currently, I
        > have my program look at DisplayWidth and DisplayHeight and if the they
        > are too large, I provide directions on how to set the resolution &
        > restart the program. On restart, if they reset the lower properly, that
        > section is skipped. Is it possible in LB to set DisplayWidth and
        > DisplayHeight? Ideally, I would like to save them & reset when the
        > program is finishing to what they were when the program started.
        > Thanks.
        > TitanGuy
        >
        >
        > [Non-text portions of this message have been removed]
        >

        I know this might not seem to helpful as I'm not including any code,
        but I don't think it should be too difficult for you to implement a
        calculation that will change the font size based on the resolution. So
        if at 800x600 14pt is good, then int(((x * y)/(800 * 600)) * 14)
        should give you a proportionally appropriate font size. Or something
        like that.
      • Stefan Pendl
        ... The easiest would be to roll your own, prompt, notice and confirm dialogs. This way you have full control and it is easy to change the font size. Use a
        Message 3 of 3 , Dec 1, 2008
        • 0 Attachment
          >
          > I am trying to use a LB program to drive a display projected on a
          > screen. If the resolution is too high, the print is too fine and the
          > audience cannot read it. (I've not found any way to change the font
          > size in the "Notice", "Confirm", or "Prompt" displays.) Currently, I
          > have my program look at DisplayWidth and DisplayHeight and if the they
          > are too large, I provide directions on how to set the resolution &
          > restart the program. On restart, if they reset the lower
          > properly, that
          > section is skipped. Is it possible in LB to set DisplayWidth and
          > DisplayHeight? Ideally, I would like to save them & reset when the
          > program is finishing to what they were when the program started.

          The easiest would be to roll your own, prompt, notice and confirm dialogs.
          This way you have full control and it is easy to change the font size.
          Use a dialog_modal window type for those.

          Without changing the resolution of the screen, you do not have to bother with resetting the screen or what will happen if your
          program crashes.
          Most people are lost, if you change something and are not able to revert your changes.

          It is better to leave the system as is and scale the windows and their contents accordingly.

          If your application is developed on 1024x768 it will need a different scale for 1280x800 (wide screen), 1280x1024 (normal screen) or
          1024x1280 (normal screen, portrait rotated).

          '---code start (watch for line wraps)
          DefaultWidth = 1024
          DefaultHeight = 768

          ScaleX = DisplayWidth / DefaultWidth
          ScaleY = DisplayHeight / DefaultHeight

          DisplayScale = min(ScaleX, ScaleY)
          '---code end

          ---
          Stefan Pendl
        Your message has been successfully submitted and would be delivered to recipients shortly.