Sack Library Documentation
|
Use 1: An image might contain a grid of symbols or characters, each exactly the same size. These may be token peices used in a game or a special graphic font.
Image peices_image = LoadImageFile( "Game Peices.image" ); PLIST peices = NULL; int x, y; #define PEICE_WIDTH 32 #define PEICE_HEIGHT 32 for( x = 0; x < 10; x++ ) for( y = 0; y < 2; y++ ) { AddLink( &peices, MakeSubImage( peices_image , x * PEICE_WIDTH, y * PEICE_HEIGHT , PEICE_WIDTH, PEICE_HEIGHT ); } // at this point there we have a list with all the tokens, // which were 32x32 pixels each. // Any of these peice images may be output using a scaled or direct blot.
Use 2: Partitioning views on an image for things like controls and other clipped regions.
Image image = MakeImageFile( 1024, 768 ); Image clock = MakeSubImage( image, 32, 32, 150, 16 ); DrawString( clock, 0, 0, BASE_COLOR_WHITE, BASE_COLOR_BLACK, "Current Time..." );
Copyright (c) 2000+. All rights reserved.
|
What do you think about this topic? Send feedback!
|