本文整理汇总了C++中BitmapRef::Bitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapRef::Bitmap方法的具体用法?C++ BitmapRef::Bitmap怎么用?C++ BitmapRef::Bitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapRef
的用法示例。
在下文中一共展示了BitmapRef::Bitmap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BarberPole
ScreenshotWindow::ScreenshotWindow(BWindow* parent, BRect frame)
:
BWindow(frame, B_TRANSLATE("Screenshot"),
B_FLOATING_WINDOW_LOOK, B_FLOATING_SUBSET_WINDOW_FEEL,
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
fBarberPoleShown(false),
fDownloadPending(false),
fWorkerThread(-1)
{
AddToSubset(parent);
atomic_set(&fCurrentScreenshotIndex, 0);
fBarberPole = new BarberPole("barber pole");
fBarberPole->SetExplicitMaxSize(BSize(100, B_SIZE_UNLIMITED));
fBarberPole->Hide();
fIndexView = new BStringView("screenshot index", NULL);
fToolBar = new BToolBar();
fToolBar->AddAction(MSG_PREVIOUS_SCREENSHOT, this,
sNextButtonIcon->Bitmap(SharedBitmap::SIZE_22),
NULL, NULL);
fToolBar->AddAction(MSG_NEXT_SCREENSHOT, this,
sPreviousButtonIcon->Bitmap(SharedBitmap::SIZE_22),
NULL, NULL);
fToolBar->AddView(fIndexView);
fToolBar->AddGlue();
fToolBar->AddView(fBarberPole);
fScreenshotView = new BitmapView("screenshot view");
fScreenshotView->SetExplicitMaxSize(
BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
fScreenshotView->SetScaleBitmap(false);
BGroupView* groupView = new BGroupView(B_VERTICAL);
groupView->SetViewColor(kBackgroundColor);
// Build layout
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
.SetInsets(0, 3, 0, 0)
.Add(fToolBar)
.AddStrut(3)
.AddGroup(groupView)
.Add(fScreenshotView)
.SetInsets(B_USE_WINDOW_INSETS)
.End()
;
fScreenshotView->SetLowColor(kBackgroundColor);
// Set after attaching all views to prevent it from being overriden
// again by BitmapView::AllAttached()
CenterOnScreen();
}