Array BLOADing 
Author Message
 Array BLOADing

I've found the source to BLOAD an image into an array like this
DIM pic1(1 TO 3154)
DEF SEG = VARSEG(frame1(1))
BLOAD "pic1.bsv", VARPTR(frame1(1))
PUT (x, y), frame1, XOR

But how would you BSAVE this array in the first place?
Remember I'm using Qbasic

Any help would be great.
Thanks



Mon, 04 Dec 2000 03:00:00 GMT  
 Array BLOADing

Quote:
>I've found the source to BLOAD an image into an array like this
>DIM pic1(1 TO 3154)
>DEF SEG = VARSEG(frame1(1))
>BLOAD "pic1.bsv", VARPTR(frame1(1))
>PUT (x, y), frame1, XOR

>But how would you BSAVE this array in the first place?
>Remember I'm using Qbasic

Are you sure your code works?  You need a DIM for frame1 instead of pic1.
Anyway, to BLOAD, you do this:

DIM frame1(1 TO 3154)
DEF SEG = VARSEG(frame1(1))
GET(x1, y1) - (x2, y2), frame1  ' x1, x2, y1 and y2 are defined by you for
whatever you're capturing.
numbytes= 4 + INT(((PMAP (x2!, 0) - PMAP (x1!, 0) + 1) *
(bits-per-pixel-per-plane%) + 7) / 8) * planes% * (PMAP (y2!, 1) - PMAP
(y1!, 1) + 1)
BSAVE "pic1.bsv", 0, numbytes

The 0 above is the offset into the segment.

See the Help file for info on  bits-per-pixel-per plane, PMAP and planes.

Tom Lake



Mon, 04 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. BLOADing data / Arrays

2. BLOADing and BSAVEing

3. QB 2 dimensional bloading?

4. Bloading image Hangs my computer

5. BLOADing a screen ON TOP of DOS

6. Arrays in Collections, Arrays in Arrays

7. Array of Arrays and 2D array

8. String to Array and Array to String

9. Filling a 3-D array from another array??

10. Change Array to Multidimensional Array

11. Arrays and pointers to arrays

12. REQ HELP on: Index Array vs Regular Multidimentional Array TIA

 

 
Powered by phpBB® Forum Software