本文整理汇总了C++中BitmapInfo::Device方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapInfo::Device方法的具体用法?C++ BitmapInfo::Device怎么用?C++ BitmapInfo::Device使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapInfo
的用法示例。
在下文中一共展示了BitmapInfo::Device方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void ViewFile::View( HWND hWnd ) {
int idx;
DWORD caps;
BitmapInfo bi;
Bitmap *map = NULL;
TCHAR buf[256];
LoadString(hInst, IDS_DB_VIEW_FILE, buf, _countof(buf));
if (!TheManager->SelectFileInputEx(&bi, hWnd, buf, TRUE))
return;
if (bi.Name()[0])
idx = TheManager->ioList.ResolveDevice(&bi);
else
idx = TheManager->ioList.FindDevice(bi.Device());
if (idx == -1)
goto error;
caps = TheManager->ioList.GetDeviceCapabilities(bi.Device());
TCHAR title[MAX_PATH];
if (caps & BMMIO_EXTENSION)
_tcscpy(title,bi.Filename());
else
_tcscpy(title,bi.Device());
if (caps & BMMIO_OWN_VIEWER) {
BitmapIO *IO = TheManager->ioList.CreateDevInstance(bi.Device());
if(IO) {
BOOL succeeded = IO->ShowImage(hWnd,&bi);
delete IO;
if(!succeeded)
goto normal_view;
}
} else {
normal_view:
SetCursor(LoadCursor(NULL,IDC_WAIT));
map = TheManager->Load(&bi);
if (map) {
map->Display(title, BMM_CN, TRUE, FALSE);
} else {
error:
TCHAR text[128];
TCHAR tmp[128];
LoadString(hInst, IDS_DB_NO_VIEW, tmp, _countof(tmp));
wsprintf(text,tmp,bi.Name());
LoadString(hInst, IDS_DB_VIEW_ERROR, tmp, _countof(tmp));
MessageBox(hWnd,text,tmp,MB_OK);
}
SetCursor(LoadCursor(NULL,IDC_ARROW));
}
}