Qbasicnews.com

Full Version: hand cramps
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
i'm getting tired of making bitmaps by hand. is there a better way?
You can always do it by foot.
Quote:You can always do it by foot.
or you can find someway to turn a gif reader into a gif to bitmap converter. i tried but failed.
you could just use premade graphics. or have someone make them for you.
bitmap as in BMP or data bit-mapping graphics?
data 00,00 ...........
you are crazy. make a damned editor in qb, or a converter using the "point" function. and don't ask me how, there's plenty of examples
Draw the image in your favorite image editor, save as a 256 color bitmap, get PP256, re-save the image in bsave format. Or just draw it in PP256 in the first place. Then use this:
Code:
' Uncomment the following to generate a bsaved image "delme.bsv" to
' test this with:
'SCREEN 13
'DIM a%(1 TO 1000)
'COLOR 12: PRINT "A";
'COLOR 10: PRINT "S";
'COLOR 9: PRINT "C";
'GET (0, 0)-(23, 7), a%
'DEF SEG = VARSEG(a%(1))
'BSAVE "delme.bsv", VARPTR(a%(1)), 24 * 8 + 4
'DEF SEG
'DO: LOOP UNTIL LEN(INKEY$)
'SCREEN 0
'WIDTH 80

PRINT "Sterling's BSAVE to DATA statement converter."
PRINT "Should work perfectly with any sprite saved in BSAVE format from PP256."
PRINT

PRINT "Enter the filename of the bsaved image:"
LINE INPUT "> ", bsv$

PRINT "Enter the filename of BAS file to append DATA statements to:"
LINE INPUT "> ", bas$

' Open FOR INPUT to cause an error if the file doesn't exist.
OPEN bsv$ FOR INPUT AS #1: CLOSE #1

OPEN bsv$ FOR BINARY AS #1
SEEK #1, 8

OPEN bas$ FOR APPEND AS #2

GET #1, , imageWidth%
GET #1, , imageHeight%

imageWidth% = imageWidth% \ 8

PRINT #2, "' Image width:"; imageWidth%;
PRINT #2, "  height:"; imageHeight%

FOR y% = 1 TO imageHeight%
   pixel% = ASC(INPUT$(1, #1))  ' program will have an error on this line
                                ' if the sprite is corrupt or truncated
   PRINT #2, USING "DATA ###"; pixel%;
  
   FOR x% = 2 TO imageWidth%
      pixel% = ASC(INPUT$(1, #1))  ' program will have an error on this line
                                   ' if the sprite is corrupt or truncated
      PRINT #2, USING ",###"; pixel%;
   NEXT x%
   PRINT #2, ""
NEXT y%

CLOSE #2

CLOSE #1
whats pp256 and where do i get it
The fourth most important thing in a sentence is PUNCTUATION.
Pages: 1 2 3