本文整理汇总了C++中CG32bitImage::WriteToWindowsBMP方法的典型用法代码示例。如果您正苦于以下问题:C++ CG32bitImage::WriteToWindowsBMP方法的具体用法?C++ CG32bitImage::WriteToWindowsBMP怎么用?C++ CG32bitImage::WriteToWindowsBMP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CG32bitImage
的用法示例。
在下文中一共展示了CG32bitImage::WriteToWindowsBMP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateSnapshot
//.........这里部分代码省略.........
int xObj;
int yObj;
Ctx.XForm.Transform(pObj->GetPos(), &xObj, &yObj);
pObj->Paint(Output, xObj, yObj, Ctx);
}
}
}
else
{
Universe.PaintPOV(Output, rcViewport, 0);
}
// Write to file
if (!sFilespec.IsBlank())
{
CString sBmpFilespec;
if (iTotalCount > 100)
sBmpFilespec = pathAddExtensionIfNecessary(strPatternSubst(CONSTLIT("%s%03d"), sFilespec, iSnapshotIndex + 1), CONSTLIT(".bmp"));
else if (iTotalCount > 1)
sBmpFilespec = pathAddExtensionIfNecessary(strPatternSubst(CONSTLIT("%s%02d"), sFilespec, iSnapshotIndex + 1), CONSTLIT(".bmp"));
else
sBmpFilespec = pathAddExtensionIfNecessary(sFilespec, CONSTLIT(".bmp"));
CFileWriteStream OutputFile(sBmpFilespec);
if (OutputFile.Create() != NOERROR)
{
printf("ERROR: Unable to create '%s'\n", sBmpFilespec.GetASCIIZPointer());
return;
}
Output.WriteToWindowsBMP(&OutputFile);
OutputFile.Close();
printf("Found %s: Saved to %s\n", sTargetName.GetASCIIZPointer(), sBmpFilespec.GetASCIIZPointer());
}
// Otherwise, clipboard
else
{
if (error = Output.CopyToClipboard())
{
printf("ERROR: Unable to copy image to clipboard.\n");
return;
}
printf("Found %s: Copied to clipboard.\n", sTargetName.GetASCIIZPointer());
}
// Reset maximum loops
iLoops = 20;
// Done
iSnapshotIndex++;
if (iSnapshotIndex >= iTotalCount)
break;
}
// Done with old system
Universe.DestroySystem(pSystem);