Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screen Resizing
#1
I have a very specific thing I'm trying to accomplish.

I am creating an Cross Platform Audio Book manager for SD-Cards with the primary platform being David Murray's "Commander X16" platform.   This is a "New"/"Retro" 8-bit computer recently in production.    


I am well on the way on the Commander X16 side of things and I wouldn't come here for help with that.  


I also want a version of the Audio Book Manager to run on Windows & Linux.    I want the look and feel between the two platforms to be as close as possible.


Due to hardware limitations my Text Screens on the X16 are going to be 40 cols x 30 rows.       I need to replicate that under QB64PE.


The closest I have got is SCREEN 0,   then WIDTH 40, 43 and VIEW PRINT 1 TO 30.    This is getting me very close but with 13 blank lines at the bottom of the Window.


If I Enable $RESIZE:ON   I can manually resize the Window and cut off these lines from view.

WHAT I WANT TO DO:    Have the Window automatically resize itself with no further resizing allowed by the User.    This will give me exactly the screen I need for the correct look and feel.  I've been combing the DOCS and example code and I really can't figure out how to do this.    It should work under both Windows & Linux.
Reply
#2
Hi. Screen 0; 40cols x 30 rows:

SCREEN _NEWIMAGE(40, 30, 0)


Reply
#3
(07-25-2024, 07:10 PM)Petr Wrote: Hi. Screen 0; 40cols x 30 rows:

SCREEN _NEWIMAGE(40, 30, 0)

     I tried that.   It works kind of.   But it gives me a Window with a very ODD aspect ratio.    The VIEW PRINT above gives me a better looking Window.
Reply
#4
Is the VIEW PRINT important to your program? 

This seems to do the job, but maybe I'm missing something. Not sure why you set the rows to 43 when you want 30...

EDIT: The output looks the same with / without the VIEW PRINT on my screen.

Code: (Select All)
Screen 0
Width 40, 32

For a = 1 To 30: Print a: Next a
Locate 1, 3
For a = 1 To 38: Print "x";: Next a
Sleep
System
Reply
#5
Ok, what aspect ratio does the font used in your other programs? QB64 uses a height of 16 pixels and a width of 8 pixels for text mode,
but this can be changed by assigning a different font. As a result, the text screen will also look different.


Reply
#6
(07-25-2024, 07:22 PM)NakedApe Wrote: Is the VIEW PRINT important to your program? 

This seems to do the job, but maybe I'm missing something. Not sure why you set the rows to 43 when you want 30...

EDIT: The output looks the same with / without the VIEW PRINT on my screen.

Code: (Select All)
Screen 0
Width 40, 32

For a = 1 To 30: Print a: Next a
Locate 1, 3
For a = 1 To 38: Print "x";: Next a
Sleep
System
  The VIEW PRINT is just so the Screen behaves like the X16 screen I'm porting from.      Just figured out that WIDTH 40, 30 actually works but the FONT Aspect at least on Linux looks better when I do the Width 40, 43.    I'll be doing the port to Linux first then tweaking it to work on Windows.    Might turn out that 40, 30 will work fine on Windows.   That would be an easy tweak.        Seems nobody quite knows how to make a window resize by itself ????    We can make the Window move by itself.   Why can we not make it resize itself ???
Reply
#7
https://qb64phoenix.com/qb64wiki/index.p...(function)
Reply
#8
(07-26-2024, 12:02 AM)Pete Wrote: https://qb64phoenix.com/qb64wiki/index.p...(function)

That reports if the Window HAS BEEN resized....   It doesn't allow you to resize it....      I know how to do Images with _PutImage and SCREEN.     Thats not what I want to do.
I want to have a SCREEN 0 window where I'm resizing the Window borders to cut off the bottom of it.    (Its going to be 40 x 43 text,  I want to "simulate" 40 x 30).    I can manually resize the window to do this from the User Interface.      

I want the program to do it without user intervention on program startup......
Reply
#9
There are various related _RESIZE examples in the wiki...

https://qb64phoenix.com/qb64wiki/index.php/$RESIZE

https://qb64phoenix.com/qb64wiki/index.php/RESIZE

Also, the search in the forums for RESIZE: https://qb64phoenix.com/forum/showthread...ght=RESIZE

I've made a few resizable apps, but I'm not a big fan of that keyword and as of right now, I can't even remember the names or functions of those apps.

Edit: Huh, I actually found one: https://qb64phoenix.com/forum/showthread...rap+resize

Pete
Reply
#10
(07-26-2024, 12:47 AM)Pete Wrote: There are various related _RESIZE examples in the wiki...

https://qb64phoenix.com/qb64wiki/index.php/$RESIZE

https://qb64phoenix.com/qb64wiki/index.php/RESIZE

Also, the search in the forums for RESIZE: https://qb64phoenix.com/forum/showthread...ght=RESIZE

I've made a few resizable apps, but I'm not a big fan of that keyword and as of right now, I can't even remember the names or functions of those apps.

Edit: Huh, I actually found one: https://qb64phoenix.com/forum/showthread...rap+resize

Pete






Pete,
          I really have already read most of what your showing me....     All of these examples show how to handle a Windows Resize initiated by a User (presumably with the Mouse). 

I WANT THE PROGRAM TO RESIZE IT'S BORDER BY ITSELF !!!!     

  Its possible that this capability is just not built in to QB64.    I'm even willing to start another program that would simulate feeding Mouse Input to my program if that's the kind of hack I have to do !!!.       


Tony..   
Reply




Users browsing this thread: 6 Guest(s)