Author Topic: Larger screen size questions  (Read 1388 times)

0 Members and 1 Guest are viewing this topic.

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Larger screen size questions
« on: May 31, 2020, 11:25:38 am »
First, pleas ignore any ignorance I have with this topic. Admittedly, I do not understand the science behind the screen/window size options. I'm wondering why, or maybe you can and I just don't understand how, can't you have a window/screen resolution higher that what is afforded in SCREEN 12? Screen 12 is 640x480 with a max column of 80 and row of 60. Why couldn't it be 640x960 and have 80 columns by 120 rows?

I guess I'm thinking/looking to where I could specify in a statement that I wanted a window of X by Y. Maybe even be able to specify the text block size. Maybe the number of pixel rows between lines of text. Maybe even the number of pixel columns between characters. Obviously you would have to make these possibilities fit some standard convention 1024x768, 1280x1024, etc.

I do see a ton of display related statements, and maybe I just don't understand (probably the case) how to use the together to do what I want; but I figured I'd ask just the same. Thanks, Mike

FellippeHeitor

  • Guest
Re: Larger screen size questions
« Reply #1 on: May 31, 2020, 11:32:37 am »
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(1024, 768, 32)

Replace 1024 and 768 for whatever width and height you want. The last parameter, 32, creates a 32-bit screen, so you'll need to use _RGB32 for color.

If you want a screen of any size but with the same color constraints as SCREEN 12 would offer:

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(1024, 768, 12)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Larger screen size questions
« Reply #2 on: May 31, 2020, 12:08:50 pm »
To add to what Fellippe said about controlling the screen pixels by width and height in

 SCREEN _NEWIMAGE(width, height, colorSet)

You can also control the rows and columns for text somewhat by carefully choosing a font and font size to load. It's not as exact as _NEWIMAGE and only a very few fonts are fully predictable about rows and columns. Sometimes PRINT and LOCATE will actually work with the user selected active font but at this point _PRINTSTRING gives more satisfying results as it locates text with pixel position precision.
« Last Edit: May 31, 2020, 12:14:49 pm by bplus »

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Re: Larger screen size questions
« Reply #3 on: May 31, 2020, 12:53:38 pm »
I knew it. There would be a way. I just didn't understand/know what to look for. And wow, that does open the possibilities for some interesting programs..... Hmmmmm. I'm kinda partial to financial/market related programs. Thanks again, Mike

Offline lawsonm1

  • Newbie
  • Posts: 64
    • View Profile
Re: Larger screen size questions
« Reply #4 on: May 31, 2020, 01:15:11 pm »
I just did a little fiddling, and found I needed to change the WIDTH command as well.

Code: QB64: [Select]
  1. 'Set the Window and Title parameters
  2. SCREEN _NEWIMAGE(1280, 960, 12) '1280x960 16 colors
  3. WIDTH 160, 120 '160 columns & 120 rows
  4. COLOR 10 'Bright green

And it appears, once you do the math to identify the ratio math, you can use standard screen sizes and adjust the WIDTH statement accordingly

Code: QB64: [Select]
  1. 'Set the Window and Title parameters
  2. SCREEN _NEWIMAGE(1024, 768, 12) '1024x768 16 colors
  3. WIDTH 128, 96 '128 columns & 96 rows
  4. COLOR 10 'Bright green

This is really interesting. I'm going to be doing some thinking. Maybe a program that can track a bunch of stocks, display the live data textually on one side of the screen, and graphically on the other side of the screen. Hmmmmm. Thanks, Mike

Offline moises1953

  • Newbie
  • Posts: 55
    • View Profile
Re: Larger screen size questions
« Reply #5 on: June 01, 2020, 06:25:19 am »
The width command size all screen text equal. Best if you change the font.
The equivalent of _width 128,96 is _font 8. You may also change to 14 o 16 wich is the default, and also you may load truetype fonts of any size
Here is a test program
Code: QB64: [Select]
  1. 'Set the Window and Title parameters
  2. DIM SHARED Phor&, Pver&, fh&, fw&, col&, lin&
  3. 'CLS
  4. Phor& = 1024: Pver& = 768 'long data
  5. SCREEN _NEWIMAGE(Phor&, Pver&, 12) '1024x768 16 colors
  6. 'WIDTH 128, 96 '128 columns & 96 rows
  7. 'FONT 8 'has the same efect & can combine, may be 14, 16
  8. 'And also may loadfont TTF
  9. fontpath$ = "Lucon.ttf": fontsize% = 20 '20x12 Windows lucida console
  10. fontmini% = 14 '14x8
  11. style$ = "MONOSPACE"
  12. hfont& = _LOADFONT(fontpath$, fontsize%, style$)
  13. hfmini& = _LOADFONT(fontpath$, fontmini%, style$)
  14.  
  15. COLOR 10 'Bright green
  16.  
  17. PRINT "Test TEXT"
  18. ComputeFont
  19. PRINT " Native Font:"; fh&; "x"; fw&, "Width:"; col&; "x"; lin&
  20.  
  21. LOCATE 3, 1
  22. ComputeFont
  23. PRINT " Medium Font:"; fh&; "x"; fw&, "Width:"; col&; "x"; lin&
  24.  
  25. LOCATE 8, 1
  26. ComputeFont
  27. PRINT "Compres Font:"; fh&; "x"; fw&, "Width:"; col&; "x"; lin&
  28.  
  29. IF hfont& THEN
  30.   _FONT hfont&
  31.   ComputeFont
  32.   LOCATE 6, 1
  33.   PRINT "Font:" + fontpath$; fh&; "x"; fw&, "Width:"; col&; "x"; lin&
  34.   _FONT hfmini&
  35.   ComputeFont
  36.   LOCATE 12, 1
  37.   PRINT "Font:" + fontpath$; fh&; "x"; fw&, "Width:"; col&; "x"; lin&
  38.  
  39. SUB ComputeFont
  40.   fh& = _FONTHEIGHT
  41.   fw& = _FONTWIDTH
  42.   col& = Phor& \ fw&
  43.   lin& = Pver& \ fh&
  44.