17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GW-BASIC <strong>User's</strong> Guide<br />

GET Statement (Graphics)<br />

Purpose:<br />

To transfer graphics images from the screen.<br />

Syntax:<br />

GET (x1,y1)-(x2,y2),array name<br />

Comments:<br />

The PUT and GET statements are used to transfer graphics images to and from the screen. PUT and<br />

GET make animation and high-speed object motion possible in either graphics mode.<br />

The GET statement transfers the screen image bounded by the rectangle described by the specified<br />

points into the array. The rectangle is defined the same way as the rectangle drawn by the LINE<br />

statement using the ,B option.<br />

The array is used simply as a place to hold the image, and can be of any type except string. It<br />

must be dimensioned large enough to hold the entire image. The contents of the array after a GET<br />

will be meaningless when interpreted directly (unless the array is of the type integer, as shown<br />

below).<br />

The storage format in the array is as follows:<br />

● 2 bytes given x dimension in bits<br />

● 2 bytes given y dimension in bits<br />

● the array data itself<br />

The data for each row of pixels is left-justified on a byte boundary. If less than a multiple of eight<br />

bits is stored, the rest of the byte will be filled out with zeros. The required array size in bytes is<br />

as follows:<br />

4+INT((x*bitsperpixel+7)/8)*y<br />

See the SCREEN statement for bits-per-pixel values for different screen modes.<br />

The bytes-per-element of an array are as follows:<br />

● 2 for integer<br />

● 4 for single-precision<br />

● 8 for double-precision<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/GETG.html (1 of 2)28/03/2004 21.29.28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!