BBC BASIC for Windows
« Custom Button maker with BMP file creation!! »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:06pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Custom Button maker with BMP file creation!!  (Read 263 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
thumbup Custom Button maker with BMP file creation!!
« Thread started on: Mar 15th, 2016, 02:36am »

Thanks for the help.
I have sourced some offered code and modified it so the BMP image file name and the button creation can be done in one command.. It automatically adjusts the BMP image for the button and saves it..
Although I do want to make the perfect buttons and this one is just made quick for a sample... Its just a basic one with a decent color and depth

I figured the object creation should be in a separate utility to reduce the code size in a program...
BUT
I could make this into a library function and then it would be a neat instant button creation tool.

If you see anything I am doing wrong please let me know.
I removed any code that was irrelevant to the program,

The ways I use variables is still the same, but I plan to change my learned ways so they are correctly done.. (not quite yet...LOL)
Code:
     
      REM SET MODE TO 8 USING VDU
      VDU 22,8
      REM SET LINE THICKNESS TO 3
      VDU 23,23,3|
      REM OFF
      GCOL 1

      REM create and save button images------------------------------------

      REM**********(Filename,H,V,BEGIN,SIZE,R,G,B,Dimmer)    Dont use .BMP as it is automatically added in PROC
      PROC_button("Mybuttonimage",500,500,15,30,200,185,200,15)
      REM The colors will be hard to adjust as you have no tool to customize the colors (YET) -its coming
      REM its really trial and error with the dimmer setting, and RGB settings.. (too much value gap can make your button look odd)
      REM MAIN --------------------------------
      (mou)
      WAIT 0 : REM just wait, nothing to do !
      GOTO (mou)

      DEF PROC_button(filename$,H,V,BEGIN,SIZE,X,C,A,DI)
      filename$=filename$+".BMP"
      R=X
      G=C
      B=A
      P=SIZE-BEGIN
      P=P/2
      P=BEGIN+P
      FOR Y=P TO SIZE
        COLOUR 1,X,C,A
        LINE H-Y,V-Y,H+Y,V-Y
        LINE H+Y,V-Y,H+Y,V+Y
        LINE H+Y,V+Y,H-Y,V+Y
        LINE H-Y,V+Y,H-Y,V-Y
        X=X-DI
        C=C-DI
        A=A-DI
        IF X<2 THEN X=2
        IF C<2 THEN C=2
        IF A<2 THEN A=2
      NEXT Y
      FOR Y=BEGIN TO P
        COLOUR 1,X,C,A
        LINE H-Y,V-Y,H+Y,V-Y
        LINE H+Y,V-Y,H+Y,V+Y
        LINE H+Y,V+Y,H-Y,V+Y
        LINE H-Y,V+Y,H-Y,V-Y
        X=X+DI
        C=C+DI
        A=A+DI
      NEXT Y
      COLOUR 1,R,G,B
      FILL H,V
      REM I hope I dont burn out any brain cells with this solution...LOL
      file1$=@usr$+ filename$
      h$=STR$(H-SIZE-5)
      v$=STR$(V-SIZE-5)
      size$=STR$(SIZE*2+10)
      combinit$=h$+","+v$+","+size$+","+size$
      pos1$=combinit$
      OSCLI "SCREENSAVE "+file1$+" "+pos1$

      ENDPROC
 
;D
« Last Edit: Mar 15th, 2016, 04:40am by michael » User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls