. ? get put blsave bload ? 
Author Message
 . ? get put blsave bload ?

qb q's:

how big an aray  to  hold a screen of graphics (screen 12, i.e.  640 * 480)
?
how to declare it
?

is the following code optimum ?
does it squander ram ?

                ------------
DECLARE SUB GTPT ()
DECLARE SUB ini ()
'---- test graphics get put  bsave dsave
DEFINT A-Z
X = 2: Y = 32000: DIM SHARED ARAY(X, Y)
'X = 1: Y = 32000: DIM SHARED ARAY(X, -Y TO Y)
ini
GTPT

SUB GTPT
GET (0, 0)-(639, 479), ARAY
LOCATE 4, 44: INPUT "pRESS A KEY"; A$
'PRINT ARAY(0, 0); ARAY(1, 0)
'       ARAY(0, 0) * ARAY(1, 0)
BSAVE "VGA.IMG", 0 + VARPTR(ARAY(0, 0)), 64000
LOCATE 5, 44: INPUT "pRESS A KEY"; A$
CLS
LOCATE 6, 44: INPUT "pRESS A KEY"; A$
BLOAD "VGA.IMG", 0
END SUB

SUB ini
CLS : SCREEN 12
DEF SEG = &HA000
LINE (0, 0)-(639, 479), , B
CIRCLE STEP(0, 0), 33
END SUB
                ------------

--
=-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
al aab, seders moderator                                      sed u soon
               it is not zat we do not see the  s o l u t i o n          
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+



Fri, 26 May 2000 03:00:00 GMT  
 . ? get put blsave bload ?

Screen 12 requires more than 64k so you'll have to take it in 2 files.
BSAVE/BLOAD only accepts (AFAIK) 64k.

The formula for computing array size is something like...

Cols%         = ((X2%-X1%) + 6 ) \ 8
Rows%         = (Y2%-Y1%)+1
Pixels%       = ( Cols% * Rows% )
BitsPerPlane% = 4  ' screen 12
Bytes%        = ( ( Pixels% * BitsPerPlane% ) \ 8 ) + 4
Elements%     = ( Bytes% \ 2 ) - 1

DIM Array%(Elements%)

Quote:
>qb q's:

>how big an aray  to  hold a screen of graphics (screen 12, i.e.  640 * 480)
>?
>how to declare it
>?

>is the following code optimum ?
>does it squander ram ?

>            ------------
>DECLARE SUB GTPT ()
>DECLARE SUB ini ()
>'---- test graphics get put  bsave dsave
>DEFINT A-Z
>X = 2: Y = 32000: DIM SHARED ARAY(X, Y)
>'X = 1: Y = 32000: DIM SHARED ARAY(X, -Y TO Y)
>ini
>GTPT

  ____    _    ____      ____  _____
 |  _ \  / \  / ___) __ | ___)(_   _)
 | |_)  / _ \ \____\/  \|  _)   | |
 |____//_/ \_\(____/\__/|_|     |_|

     www.basicguru.com/schullian


Sat, 27 May 2000 03:00:00 GMT  
 . ? get put blsave bload ?

Quote:
>how big an aray  to  hold a screen of graphics (screen 12, i.e.  640 * 480)

the formula for the size of the array is (width * heigth) / 2 - 1


Sat, 27 May 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help: Bload, Bsave, Put, Get

2. Getting the screen's address (BLOAD)

3. Help with Getting info from a web page and putting it into a database

4. Getting file info using a file list box and putting in an array

5. Getting a single char, Putting a single char.

6. Putting a picture in a report, but getting just the path from database

7. Getting Types that were Put from an Array

8. Declaring an array of pointers in Visual Basic (and putting and getting data from it)

9. Declaring an array of pointers in Visual Basic (and putting and getting data from it)

10. bsave/bload help!

11. BLOAD: BASICA --> QBASIC

12. BLOAD BSAVE

 

 
Powered by phpBB® Forum Software