LB Booster
« Search Results »

Welcome Guest. Please Login or Register.
Jun 23rd, 2017, 03:26am


Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
LB Umbrella forum
Liberty BASIC forum (the original)

Search Results

Total results: 10


 1   Liberty BASIC language / Re: Command line parameter for the ".exe"  on: Jun 20th, 2017, 07:50am
Started by flotulopex | Post by flotulopex
Thanks wink
 
  Reply Quote Notify of replies

 2   Liberty BASIC language / Re: Command line parameter for the ".exe"  on: Jun 19th, 2017, 1:45pm
Started by flotulopex | Post by Richard Russell
on Jun 19th, 2017, 10:20am, flotulopex wrote:
Is there an option to have command line parameters when launching an exe file?

Yes, CommandLine$ is supported just as it is in LB 4. You can find more details and examples of its use in the LB 4.04 or 4.5.0 Help File (if you've got the CHM version use the Search tab).

Richard.


 
  Reply Quote Notify of replies

 3   Liberty BASIC language / Re: Store and une a filename in a variable  on: Jun 19th, 2017, 1:35pm
Started by flotulopex | Post by Richard Russell
on Jun 19th, 2017, 09:50am, flotulopex wrote:
I had to do it this way

I'm not too sure what point you are making. The leading ".\" to the file specification doesn't achieve anything ('dot' is the current directory anyway); you would probably be better to use DefaultDir$ like this:

Code:
LOADBMP "BackgroundImage", DefaultDir$ + "\" + ImageName$ + ".bmp" 

Richard.
 
  Reply Quote Notify of replies

 4   Liberty BASIC language / Command line parameter for the ".exe"  on: Jun 19th, 2017, 10:20am
Started by flotulopex | Post by flotulopex
Hi,

Is there an option to have command line parameters when launching an exe file?

i.e: program.exe /?
or
i.e: program.exe /a /b /c

Rog'
 
  Reply Quote Notify of replies

 5   Liberty BASIC language / Re: Store and une a filename in a variable  on: Jun 19th, 2017, 09:50am
Started by flotulopex | Post by flotulopex
I had to do it this way:

Code:
...
[MAIN_REFRESH]
   UNLOADBMP "BackgroundImage"
   LOADBMP ".\" + ImageFile$ + ".bmp"
   #MainWindow.GBx1 "down"
   #MainWindow.GBx1 "drawbmp BackgroundImage 0 0"
   WAIT

...
[MouseLeftButton]
   IF (MouseX > 1685 AND MouseX < 1770) THEN    'Aucune
      IF (MouseY > 1055 AND MouseY < 1069) THEN
         ImageFile$ = "Aucune"
         GOTO [MAIN_REFRESH]
      END IF
   END IF 

 
  Reply Quote Notify of replies

 6   Liberty BASIC language / Re: Store and une a filename in a variable  on: Jun 18th, 2017, 4:04pm
Started by flotulopex | Post by Richard Russell
on Jun 18th, 2017, 05:52am, flotulopex wrote:
one point would be to handle BMP files via a variable (ImageFile$) instead of having to name each file every time.

What's the problem? Are you saying that this line from your program isn't working:

Code:
LOADBMP "BackgroundImage",ImageFile$ 

Even the LBB docs show a variable being used for the filename, so it should certainly be OK.

Quote:
NB: how do I attach a file to the thread?

You can't, as far as I know.

Richard.

 
  Reply Quote Notify of replies

 7   Liberty BASIC language / Store and une a filename in a variable  on: Jun 18th, 2017, 05:52am
Started by flotulopex | Post by flotulopex
Hi,

I'm trying to improve a small program I just finished and one point would be to handle BMP files via a variable (ImageFile$) instead of having to name each file every time.

The purpose of the program is to display the actual kind of dance played and the user can select them by directly clicking on each image's list (easy to understand - I wish I could attach some images).

Code:
' Image Launcher short

NOMAINWIN

   WindowWidth = 1920
   WindowHeight = 1080

   LOADBMP "BackgroundImage",".\Aucune.bmp"

   GRAPHICBOX #MainWindow.GBx1,0,0,1920,1080
   STYLEBITS  #MainWindow.GBx1,0,_WS_BORDER,0,0

[MAIN]
   OPEN "Display BMP image" FOR window_popup AS #MainWindow
   #MainWindow "TRAPCLOSE [QUIT_MAIN_WINDOW]"
   #MainWindow.GBx1 "down"
   #MainWindow.GBx1 "drawbmp BackgroundImage 0 0"
   #MainWindow.GBx1 "when leftButtonDown [MouseLeftButton]"
   WAIT

[MAIN_REFRESH]
'***
LOADBMP "BackgroundImage",ImageFile$
'***
   #MainWindow.GBx1 "down"
   #MainWindow.GBx1 "drawbmp BackgroundImage 0 0"
   WAIT

[QUIT_MAIN_WINDOW]
   CLOSE #MainWindow
   END

[MouseLeftButton]
   IF (MouseX > 1685 AND MouseX < 1770) THEN    'Aucune
      IF (MouseY > 1055 AND MouseY < 1069) THEN
         UNLOADBMP "BackgroundImage"
'****
         'LOADBMP "BackgroundImage",".\Aucune.bmp"
ImageFile$ = ".\Aucune.bmp"
'****
         GOTO [MAIN_REFRESH]
      END IF
   END IF

   IF (MouseX > 603 AND MouseX < 671) THEN    'Bachata
      IF (MouseY > 962 AND MouseY < 979) THEN
         UNLOADBMP "BackgroundImage"
'****
         'LOADBMP "BackgroundImage",".\Bachata.bmp"
ImageFile$ = ".\Bachata.bmp"
'****
         GOTO [MAIN_REFRESH]
      END IF
   END IF

   IF (MouseX > 207 AND MouseX < 315) THEN    'Cha-Cha-Cha
      IF (MouseY > 919 AND MouseY < 935) THEN
         UNLOADBMP "BackgroundImage"
'****
         'LOADBMP "BackgroundImage",".\Cha-Cha-Cha.bmp"
ImageFile$ = ".\Cha-Cha-Cha.bmp"
'****
         GOTO [MAIN_REFRESH]
      END IF
   END IF

   IF (MouseX > 1820 AND MouseY > 1045) THEN GOTO [QUIT_MAIN_WINDOW] ' "Quitter"
   WAIT 

The changes are between '*** .

NB: how do I attach a file to the thread?

 
  Reply Quote Notify of replies

 8   General Board / Re: Embedded .bmp files  on: Jun 18th, 2017, 05:31am
Started by flotulopex | Post by flotulopex
Well, thanks a lot again and one more "bravo" for you and LBB wink
 
  Reply Quote Notify of replies

 9   General Board / Re: Embedded .bmp files  on: Jun 17th, 2017, 10:06pm
Started by flotulopex | Post by Richard Russell
on Jun 17th, 2017, 8:43pm, flotulopex wrote:
What an excellent surprise but...how did you do this?

The embedded files are compressed using quite an efficient algorithm (not as good as Zip, but close) - it's actually the aPLib compression library which you'll notice is acknowledged in the LBB docs.

Depending on the kind of images they contain, BMP files are often quite easily compressed. If you zip your 25 bitmaps you will no doubt find that they end up considerably smaller than the executable made by LBB.

Richard.
 
  Reply Quote Notify of replies

 10   General Board / Embedded .bmp files  on: Jun 17th, 2017, 8:43pm
Started by flotulopex | Post by flotulopex
Hi Richard,

I just finished a small program that uses around 25 bmp files that are each around 6MB (1920x1080, 24bit).

I embedded the bmp files in the executable and the exe weights only 722kB (!?) instead of the total 150MB.

What an excellent surprise but...how did you do this?

Roger
 
  Reply Quote Notify of replies


Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls