General Block Transfer

We'll start with the most general block transfer function, fg_vbcopy(). It copies a block between two virtual buffers, or to a non-overlapping position in the same virtual buffer. The fg_vbcopy() function requires eight parameters. Its first four parameters define the minimum x, maximum x, minimum y, and maximum y screen space coordinates of the region to copy from the source virtual buffer. The next two parameters define the x and y coordinates for lower left corner of the block in the destination virtual buffer. The final two parameters specify the handles for the source and destination virtual buffers. To copy a block within a virtual buffer, just specify its handle as both the source and destination virtual buffer handles. Neither virtual buffer needs to be the active virtual buffer, but both virtual buffers must have the same color depth.

Suppose, for example, that we've created two 320x240 virtual buffers:

C/C++:

hVB1 = fg_vballoc(320,240);
hVB2 = fg_vballoc(320,240);

Delphi:

hVB1 := fg_vballoc(320,240);
hVB2 := fg_vballoc(320,240);

Visual Basic:

hVB1 = fg_vballoc(320, 240)
hVB2 = fg_vballoc(320, 240)

If we want to copy the entire contents of the first virtual buffer into the second, we could do so like this:

C/C++ and Delphi:

fg_vbcopy(0,319,0,239,0,239,hVB1,hVB2);

Visual Basic:

Call fg_vbcopy(0, 319, 0, 239, 0, 239, hVB1, hVB2)

If we want to copy the top half of the first virtual buffer to the bottom half, we could do this:

C/C++ and Delphi:

fg_vbcopy(0,319,0,119,0,239,hVB1,hVB1);

Visual Basic:

Call fg_vbcopy(0, 319, 0, 119, 0, 239, hVB1, hVB1)

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.