Functions



BitmapView

Abstract: Constructor
public:

BitmapView( BRect frame, const char* name, BBitmap* bitmap, uint32 resizingMode, uint32 flags );

Sets up a new BitmapView, using a given BBitmap*.

Parameters

NameDescription
frameSee BView::BView().
nameSee BView::BView().
bitmapA pointer to the bitmap to display. The BitmapView will assume ownership of this bitmap. If bitmap is NULL, an empty 32x32 black-and-white bitmap will be created and used.
resizingModeSee BView::BView().
flagssee BView::BView(). These flags will be |ed with B_WILL_DRAW.

BitmapView

Abstract: Constructor
public:

BitmapView( BRect frame, const char* bitmapName, uint32 resizingMode, uint32 flags );

Sets up a new BitmapView, using the bitmap with a given name.

Parameters

NameDescription
frameSee BView::BView().
nameSee BView::BView().
bitmapNameEither a filename of a bitmap to display, or the name of a B_TRANSLATOR_BITMAP application resource to display.
resizingModeSee BView::BView().
flagssee BView::BView(). These flags will be |ed with B_WILL_DRAW.

Draw

Abstract: Redraws the BitmapView.
public:

virtual void Draw( BRect updateRect );

This function is called whenever the view needs to be redrawn.

Parameters

NameDescription
updateRectThe rectangle that needs updating, expressed in the view coordinate system.

GetBitmap

Abstract: Returns the view's current bitmap.
public:

inline BBitmap* GetBitmap() { return fBitmap; };

Returns a pointer to the view's current bitmap. This is the actual bitmap contained in the view; you may modify it but you must not delete it. If you modify it, you should call Invalidate() afterwards.

Result: The view's current bitmap.

GetPreferredSize

Abstract: Determines the view's preferred size. *
public:

virtual void GetPreferredSize( float* width, float* height );

This function returns this BitmapView's preferred size (namely, the size of the bitmap).

Parameters

NameDescription
widthPointer to a variable that will receive this view's preferred width.
heightPointer to a variable that will receive this view's preferred height.

SetBitmap

Abstract: Sets this view's bitmap.
public:

void SetBitmap( BBitmap* bitmap );

Sets the displayed bitmap to bitmap, and assumes ownership of it. Deletes the view's previous bitmap.

Parameters

NameDescription
bitmapThe new bitmap to display. This parameter may not be NULL.

~BitmapView

Abstract: Destructor
public:

~BitmapView();

Deletes the BitmapView, freeing all memory associated with it (including its bitmap).


© 2000 BeUnited — (Last Updated 5/10/2000)