Bypass navigation menu
RGB Classic Games
Keeping the classics alive
Currently hosting 566 great games!
Return to Chapter 2

ExtGet(X1, Y1, X2, Y2, Image[Index])

Stores a graphics image from X1, Y1 to X2, Y2 into the an integer array.

This is used with the ExtPut function to store and transfer areas of the graphics screen. Be EXTREMELY careful when using this function in making sure the array is large enough to hold the entire image you are storing. If not, this function will cheerfully overwrite anything after the ending position of the array in your program. This includes other variables, or even program instructions. The result would be less than pleasurable I assure you. Fortunately, there is a simple solution to this problem that can be set up in your program to see that this terrible event never occurs. Use the following procedure to determine if the array is large enough to safely store the whole image:

SafeSize = ((W / 4) + 6) * H
H - Image's number of points in height W - Image's number of points in width

ArraySize = L - S + 1
L - Integer array's largest possible index number
S - Integer array's smallest possible index number

IF ArraySize < SafeSize THEN DON'T execute this function

Most programming languages allow you to determine an array's smallest and largest index number. If the language you are working in doesn't have this capability then you'll have to supply those figures yourself.

Parameters

X1 - Upper left horizontal position to store
Y1 - Upper left vertical position to store
X2 - Lower right horizontal position to store
Y2 - Lower right vertical position to store
Image[Index] - Integer array to hold graphic image starting at the specified index

Examples

BASIC

CALL ExtGet(0, 0, 50, 75, Image%(0))

PASCAL

ExtGet(0, 0, 50, 75, Image[0]);