本文整理汇总了C++中FileSel::GetActiveDir方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSel::GetActiveDir方法的具体用法?C++ FileSel::GetActiveDir怎么用?C++ FileSel::GetActiveDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSel
的用法示例。
在下文中一共展示了FileSel::GetActiveDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadImage
void ImageMT::LoadImage()
{
FileSel dlg;
dlg.Type("Image files","*.bmp *.png *.tif *.jpg");
dlg.Type("Image: JPEG","*.jpg");
dlg.Type("Image: Portable Nework Graphics","*.png");
dlg.Type("Image: Tagged Image Format","*.tif");
dlg.Type("Image: Windows Bitmap (24bit)","*.bmp");
dlg.ActiveDir(GetCurrentDirectory());
if(!dlg.ExecuteOpen("Open Image"))return;
SetCurrentDirectory(dlg.GetActiveDir());
String path = ~dlg;
FileIn in(path);
if(in.IsError())
{
String s = Format("Error opening image file %s",path);
PromptOK(s);
return;
}
One<StreamRaster> r = StreamRaster::OpenAny(in);
if(!r)
{
String s = Format("Error opening streamraster file %s",path);
PromptOK(s);
return;
}
Layer* pLayer = new Layer;
Size sz = GetSize();
pLayer->m_img = r->GetImage();
pLayer->m_rc.left = 0;
pLayer->m_rc.right = 1;
pLayer->m_rc.top = 0;
pLayer->m_rc.bottom = 1;
m_pLayers.Add(pLayer);
}