Add SetBitmap(const char*) method to set the bitmap from a file using the Translation Kit.

This commit is contained in:
plfiorini 2010-05-28 00:47:00 +00:00
parent c777593fa7
commit bcbff8db1f
2 changed files with 10 additions and 1 deletions

View File

@ -51,6 +51,14 @@ BitmapView::Bitmap() const
} }
void
BitmapView::SetBitmap(const char* filename)
{
delete fBitmap;
fBitmap = BTranslationUtils::GetBitmap(filename);
}
void void
BitmapView::SetBitmap(BBitmap* bitmap) BitmapView::SetBitmap(BBitmap* bitmap)
{ {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2009, Pier Luigi Fiorini. All rights reserved. * Copyright 2009-2010, Pier Luigi Fiorini. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _BITMAP_VIEW_H #ifndef _BITMAP_VIEW_H
@ -18,6 +18,7 @@ public:
status_t InitCheck(); status_t InitCheck();
BBitmap* Bitmap() const; BBitmap* Bitmap() const;
void SetBitmap(const char* filename);
void SetBitmap(BBitmap* bitmap); void SetBitmap(BBitmap* bitmap);
virtual BSize MinSize(); virtual BSize MinSize();