BTranslationUtils

Constructor and Destructor

The BTranslationUtils class only contains static functions and so there is no constructor or destructor.

Static Functions

GetBitmap()

static BBitmap BTranslationUtils::GetBitmap(const char *name, BTranslatorRoster name = NULL)
static BBitmap BTranslationUtils::GetBitmap(entry_ref ref, BTranslatorRoster name = NULL)
static BBitmap BTranslationUtils::GetBitmap(uint32 type, int32 id, BTranslatorRoster name = NULL)
static BBitmap BTranslationUtils::GetBitmap(uint32 type, const char *name, BTranslatorRoster name = NULL)
static BBitmap BTranslationUtils::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.

GetBitmapFile()

static BBitmap BTranslationUtils::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.