BBC BASIC for Windows
Programming >> Graphics and Games >> BMPTOCODE :A sky full of rating stars (ART)
http://bb4w.conforums.com/index.cgi?board=graphics&action=display&num=1458642104

BMPTOCODE :A sky full of rating stars (ART)
Post by michael on Mar 22nd, 2016, 10:21am

By now you probably notice I have a interest in making graphics with just code..

This is a product of an old program I made named BMPTOCODE..
1) It first loads a BMP image and then converts the image into compressed file code (3 levels of compression)
2) it then GENERATES a fully functional program.. (its this easy)

BMPTOCODE was a hard project and it has its place in history as the first BMP image to code converter (I could be wrong)

As BMPTOCODE used windows APIs, this is only a converted showcase
Code:
     
 REM VDU 22,8
      REM VDU 23,23,2|
      MODE 8
      OFF
      GCOL 1

      FOR loop= 1 TO 100
        h= 200
        v= 200
        x=0:r=0:g=0:b=0
        y=0
        u=0
        c=0
        t=0
        nst$=""
        ost$=""
        c=0
        a=0
        col=0
  
        h= RND(1500)
        v= RND(1000)
        PROC_star(h,v)
        RESTORE
      NEXT loop
      WAIT 0
      (quit)

      END

      DEF PROC_star(h,v)
      READ x,y

      (beg)
      READ nst$,t
      IF nst$="100000" THEN GOTO (jump)
      IF nst$="0" THEN  col=0   REM black
      IF nst$="3" THEN  col=8   REM gray
      IF nst$="b" THEN  col=9   REM red
      IF nst$="h" THEN  col=15  REM white
      IF nst$="i" THEN  col=3   REM yellow

      GCOL col
      FOR u=0 TO t
        a=a+1: MOVE h+c,v-a:DRAW h+c,v-a:IF a>x  THEN c=c+1:a=0
      NEXT u
      GOTO (beg)
      (jump)
      DATA 16,16
      DATA 0,5,b,0,0,15,b,1,0,14,b,0,h,0,b,0,0,13,b,0,i,0,b,0,0,4,b,1,0,6,b,0,i,1,b,0,0,0,b,3,0
      DATA 7,b,0,i,2,b,0,h,0,i,1,b,0,0,7,b,0,i,5,b,0,0,5,b,2,i,5,h,0,b,0,0,3,b,1,h,1,i,6,b,0
      DATA 0,6,b,2,h,0,i,5,b,0,0,8,b,0,i,2,h,1,i,0,b,0,0,8,b,0,i,1,h,0,b,0,h,2,b,0,0,7,b,0,i
      DATA 0,h,0,b,0,0,0,b,3,0,7,b,0,h,0,b,0,0,4,b,1,0,6,b,0,h,0,b,0,0,13,b,1,100000,0
      ENDPROC