本文整理汇总了C++中BScreen::GetBitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ BScreen::GetBitmap方法的具体用法?C++ BScreen::GetBitmap怎么用?C++ BScreen::GetBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BScreen
的用法示例。
在下文中一共展示了BScreen::GetBitmap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scaledBounds
status_t
MakeScreenshot(BBitmap **here)
{
status_t err;
BScreen bs;
BWindow *win;
BBitmap *shot;
BBitmap *scaledBmp = NULL;
be_app->Lock();
win = be_app->WindowAt(0);
if (win) {
win->Lock();
win->Hide();
win->Unlock();
}
snooze(500000);
err = bs.GetBitmap(&shot);
if (!err) {
BRect scaledBounds(0,0,640-1,480-1);
scaledBmp = new BBitmap(scaledBounds, B_BITMAP_ACCEPTS_VIEWS, B_RGB32/*shot->ColorSpace()*/);
err = scaledBmp->InitCheck();
if (!err) {
err = ENOSYS;
#ifdef B_ZETA_VERSION
err = ScaleBitmap(*shot, *scaledBmp);
#endif
if (err) {
// filtered scaling didn't work, do it manually
BView *v = new BView(scaledBounds, "scaleview", B_FOLLOW_NONE, 0);
scaledBmp->AddChild(v);
v->LockLooper();
v->DrawBitmap(shot);
v->Sync();
v->UnlockLooper();
scaledBmp->RemoveChild(v);
delete v;
err = B_OK;
}
}
delete shot;
}
if (win) {
win->Lock();
win->Show();
win->Unlock();
}
be_app->Unlock();
if (err)
return err;
*here = scaledBmp;
return B_OK;
}