本文整理汇总了C++中BitmapInfo::Filename方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapInfo::Filename方法的具体用法?C++ BitmapInfo::Filename怎么用?C++ BitmapInfo::Filename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapInfo
的用法示例。
在下文中一共展示了BitmapInfo::Filename方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
/// Called to update the controls of the dialog
virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map )
{
ICustButton *bmSelectBtn;
IParamBlock2 *pblock;
int i;
long buttons[ 6 ] = { IDC_FRONT_NAME, IDC_BACK_NAME, IDC_LEFT_NAME, IDC_RIGHT_NAME, IDC_TOP_NAME, IDC_BOTTOM_NAME };
BitmapInfo bi;
ParamMap2UserDlgProc::Update( t, valid, map );
pblock = map->GetParamBlock();
for( i = plStaticEnvLayer::kBmpFrontBitmap; i <= plStaticEnvLayer::kBmpBottomBitmap; i++ )
{
bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), buttons[ i ] ) );
PBBitmap *pbbm = pblock->GetBitmap( i, t );
if( pbbm )
bmSelectBtn->SetText( (TCHAR *)pbbm->bi.Filename() );
else
bmSelectBtn->SetText( _T( "None" ) );
ReleaseICustButton( bmSelectBtn );
}
plStaticEnvLayer *layer = (plStaticEnvLayer *)map->GetParamBlock()->GetOwner();
bi.SetName( layer->GetBaseFilename( t ) );
SetDlgItemText( map->GetHWnd(), IDC_BASE_FILENAME, bi.Filename() );
map->Enable( plStaticEnvLayer::kBmpGenerateFaces, ( bi.Name() == NULL || bi.Name()[ 0 ] == 0 ) ? FALSE : TRUE );
bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), IDC_GENERATE_FACES ) );
bmSelectBtn->SetText( _T( "Generate From Node" ) );
ReleaseICustButton( bmSelectBtn );
i = pblock->GetInt( plStaticEnvLayer::kBmpTextureSize, t );
pblock->SetValue( plStaticEnvLayer::kBmpLastTextureSize, t, i );
}
示例2: if
//
// Create Bitmap
//
plMipmap *plBitmapCreator::ICreateBitmap(plBitmapData *bd)
{
hsGuardBegin("hsConverterUtils::CreateBitmap");
// Load the bitmap
BitmapInfo bi;
bi.SetName(bd->fileName.AsString().c_str());
#if 0 // This isn't really an issue since the textures are packed -Colin
const int kMaxFileNameLength = 30;
if (strlen(bi.Filename()) > kMaxFileNameLength)
{
// Allow to continue, But make it painful
char errStr[256];
sprintf(errStr, "File name longer than %d, won't burn to CD (%s)", kMaxFileNameLength, bi.Filename());//bitmapTex->GetName());
MessageBox(GetActiveWindow(), errStr, bd->fileName, MB_OK|MB_ICONEXCLAMATION);
}
#endif
bool notMipped = (bd->texFlags & plMipmap::kForceOneMipLevel) != 0;
float sigma = bd->sig;
// Load the bitmap
Bitmap *bm = TheManager->Load(&bi);
if (!bm)
{
// FIXME
/*
if (fErrorMsg->Set(!(fWarned & kWarnedNoMoreBitmapLoadErr),
"Error loading bitmap", pathName).CheckAskOrCancel())
{
fWarned |= kWarnedNoMoreBitmapLoadErr;
}
*/
return nil;
}
BitmapStorage *storage = bm->Storage();
BitmapInfo *bInfo = &storage->bi;
ICheckOutBitmap(bInfo, bm, bd->fileName);
//
// Create a plMipmap
//
plMipmap *hBitmap = new plMipmap;
if( (bm->Width() ^ (bm->Width() & -bm->Width()))
||(bm->Height() ^ (bm->Height() & -bm->Height())) )
{
IResampBitmap(bm, *hBitmap);
}
else if( ((bm->Width() >> 3) > bm->Height())||((bm->Height() >> 3) > bm->Width()) )
{
IResampBitmap(bm, *hBitmap);
}
else
{
示例3:
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));
}
}
示例4: BuildShaders
//.........这里部分代码省略.........
continue;
}
// Get texmaps
std::vector<std::string> vecTextures, vecPaths;
CShaderStandard::SLayerInfo layerInfo;
CShaderStandard::SBitmapInfo bitmapInfo;
if(pMaxTexmap->ClassID() == Class_ID(BMTEX_CLASS_ID, 0))
{
BitmapTex* pMaxBitmapTex = (BitmapTex*)pMaxTexmap;
Bitmap* pMaxBitmap = pMaxBitmapTex->GetBitmap(SECONDS_TO_TICKS(m_fStartTime));
StdUVGen* pMaxUVGen = pMaxBitmapTex->GetUVGen();
if(!pMaxBitmap)
{
if(i == 0)
{
LOG.Write("\n Invalid diffuse. Skipping.");
break;
}
continue;
}
assert(pMaxUVGen);
BitmapInfo bi = pMaxBitmap->Storage()->bi;
// bi.Name() returns the full path
// bi.Filename() returns just the filename
vecTextures.push_back(bi.Filename());
vecPaths. push_back(bi.Name());
LOG.Write("\n Bitmap %s", vecTextures[0].data());
// Check if diffuse texture has alpha channel
if(i == 0)
{
CBitmap bitmap;
CInputFile bitmapFile;
if(!bitmapFile.Open(bi.Name(), false))
{
CLogger::NotifyWindow("WARNING - CStravaganzaMaxTools::BuildShaders():\nUnable to load file %s", bi.Name());
}
else
{
if(!bitmap.Load(&bitmapFile, GetFileExt(bi.Name())))
{
CLogger::NotifyWindow("WARNING - CStravaganzaMaxTools::BuildShaders():\nUnable to load bitmap %s", bi.Name());
}
else
{
if(bitmap.GetBpp() == 32)
{
bDiffuseMap32Bits = true;
LOG.Write(" (with alpha channel)");
}
bitmap.Free();
}
bitmapFile.Close();
}