While the Bitmap structure above is used for working with a single bitmapped image, the BitmapSequence is used for working with a Bitmap array. To create a BitmapSequence object, you must use the BitmapSequence_ctor function.
Use the BitmapSequence_dtor function to release the created object by after you work with it. To receive the bitmap object from the bitmap sequence, use the BitmapSequence_get_bitmap function.
The BitmapSequence get size function determines the number of bitmap objects in the BitmapSequence object you can receive. Bitmap structure operations with streams are designated the same way. They are implemented in the BitmapSequence_load and BitmapSequence_store functions.
Please pay special attention to the examples for these functions.
Simple BitmapSequence constructor.
Creates an empty bitmap sequence.
#include <cybiko.h> ... struct BitmapSequence bmps; BitmapSequence_ctor( &bmps ); ... BitmapSequence_dtor( &bmps, LEAVE_MEMORY );
This is the extended version of the BitmapSequence_ctor function.
It allows you to use a resource for creating a BitmapSequence object.
#include <cybiko.h> ... struct BitmapSequence bmps; BitmapSequence_ctor_Ex( &bmps, "MyFont.pic" ); ... BitmapSequence_dtor( &bmps, LEAVE_MEMORY );
Destructor.
This function deletes the BitmapSequence object.
#include <cybiko.h> ... struct BitmapSequence bmps; BitmapSequence_ctor_Ex( &bmps, "MyFont.pic" ); ... BitmapSequence_dtor( &bmps, LEAVE_MEMORY );
Returns a pointer on the Bitmap object that has the 'bitmap_index' index.
#include <cybiko.h> ... struct BitmapSequence bmps; struct Bitmap * ptr_bmp_symbol_A; BitmapSequence_ctor_Ex( &bmps , "font_1.pic" ); ... ptr_bmp_symbol_A = BitmapSequence_get_bitmap( &bmps, 0 ); BitmapSequence_dtor( &bmps, LEAVE_MEMORY );
Returns the number of bitmaps in a BitmapSequence object.
#include <cybiko.h> ... struct BitmapSequence bmps; BitmapSequence_ctor_Ex( &bmps, "MyFont.pic" ); ... TRACE( "%d symbols in this font", BitmapSequence_get_size( &bmps ) ); ... BitmapSequence_dtor( &bmps, LEAVE_MEMORY );
Loads the bitmap sequence from an opened stream.
#include <cybiko.h> ... struct Input * ptr_input; struct BitmapSequence bmps; ... // Your make file must have the archive resource "bmp.pic" linked by filer.exe. // For an example, see the Cybiko Compiler's Introduction Section. ptr_input = open_resource_Ex( "font_1.pic" ); ... if( !BitmapSequence_load( &bmps, ptr_input ) ) { ... } ... BitmapSequence_dtor( &bmps, LEAVE_MEMORY ); Input_dtor( ptr_input, FREE_MEMORY );
Stores a bitmap sequence to an opened stream.
#include <cybiko.h> ... struct Output * ptr_output; bool fBmp_store; struct BitmapSequence bmps; struct module_t main_module; ... init_module( &main_module ); // Application module initialization ... BitmapSequence_ctor( &bmps ); ... // Your make file must have the archive resource "bmp.pic" linked by filer.exe. // For an example, see the Cybiko Compiler's Introduction Section. ptr_output = Archive_open_write_Ex( main_module.m_process->module->archive, "font_1.pic" ); fBmp_store = BitmapSequence_store( &bmps, ptr_output ); ... BitmapSequence_dtor( &bmps, LEAVE_MEMORY ); Output_dtor( ptr_output, FREE_MEMORY );