7 #include "BitmapView.h"
10 BitmapView::BitmapView(BRect frame
, const char* name
,
12 : BView(frame
, name
, B_FOLLOW_NONE
, B_WILL_DRAW
| B_FULL_UPDATE_ON_RESIZE
),
15 SetViewColor(B_TRANSPARENT_32_BIT
);
16 SetHighColor(255, 0, 0, 255);
20 BitmapView::~BitmapView()
27 BitmapView::Draw(BRect updateRect
)
30 if (fBitmap
->ColorSpace() == B_RGBA32
) {
31 // draw the bitmap with pixel alpha
32 // against a red background
34 SetDrawingMode(B_OP_ALPHA
);
35 SetBlendingMode(B_PIXEL_ALPHA
, B_ALPHA_OVERLAY
);
37 DrawBitmap(fBitmap
, Bounds().LeftTop());
43 BitmapView::MouseDown(BPoint where
)
49 BitmapView::MouseUp(BPoint where
)
55 BitmapView::MouseMoved(BPoint where
, uint32 transit
,
56 const BMessage
* dragMessage
)