| Class Overview |
The BTranslationUtils class
only contains static functions and so there is no constructor
or destructor.
static BBitmap GetBitmap(const char* name,
BTranslatorRoster name = NULL);
static BBitmap GetBitmap(entry_ref ref,
BTranslatorRoster name = NULL);
static BBitmap GetBitmap(uint32 type,
int32 id,
BTranslatorRoster name = NULL);
static BBitmap GetBitmap(uint32 type,
const char* name,
BTranslatorRoster name = NULL);
static BBitmap GetBitmap(BPositionIO stream = NULL,
BTranslatorRoster name = NULL);
The first version of the function returns the image held in the file name
if it exists. Otherwise, it returns the application resource of type
B_TRANSLATOR_BITMAP named name.
The second version does the same thing,
but uses an entry_ref, ref, to locate the file.
The third and fourth versions of the function search for the specified resource and return the bitmap contained therein.
The final version returns the bitmap found in stream. This form of the
function is particularly useful when used with
BMemoryIO.
In all cases, use specifies the BTranslatorRoster to use in translating
the image. If use is NULL, the default translator (as returned by
BTranslatorRoster::Default())
is used.
If the file or stream doesn't contain a suitable bitmap, the functions
return NULL.
static BBitmap GetBitmapFile(const char* name,
BTranslatorRoster name = NULL);Returns the image held in the file name. If
the file doesn't contain a suitable image, the function returns
NULL. use specifies the
BTranslatorRoster used to translate the image. If
use is NULL, the default
translator (as returned by
BTranslatorRoster::Default())
is used.