本文整理汇总了C++中DateTime::GetSec方法的典型用法代码示例。如果您正苦于以下问题:C++ DateTime::GetSec方法的具体用法?C++ DateTime::GetSec怎么用?C++ DateTime::GetSec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTime
的用法示例。
在下文中一共展示了DateTime::GetSec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TimerTick
void CameraDelayedLooper::TimerTick(int nID)
{
if (nID == CAMERA_ID)
{
DateTime pcTime = DateTime::Now();
BitmapImage* pcBitmapImage;
BitmapImage* pcSaveImage;
os::String cScreenShotPath;
os::Desktop m_Screen;
pcSaveImage = new os::BitmapImage( Bitmap::SHARE_FRAMEBUFFER | Bitmap::ACCEPT_VIEWS );
pcSaveImage->SetColorSpace( CS_RGBA32 );
pcSaveImage->ResizeCanvas( os::Point( m_Screen.GetResolution() ) );
pcBitmapImage = new os::BitmapImage((uint8*)m_Screen.GetFrameBuffer(),m_Screen.GetResolution(),m_Screen.GetColorSpace());
pcBitmapImage->Draw( os::Point( 0, 0 ), pcSaveImage->GetView() );
pcSaveImage->Sync();
cScreenShotPath = os::String().Format("%s/Pictures/Screenshot-%d-%d-%d-%d_%d_%d.png",getenv("HOME"),pcTime.GetYear(),pcTime.GetMonth(),pcTime.GetDay(),pcTime.GetHour(),pcTime.GetMin(),pcTime.GetSec());
File vNewFile = os::File(cScreenShotPath,O_CREAT | O_TRUNC | O_WRONLY);
vNewFile.WriteAttr("os::MimeType", O_TRUNC, ATTR_TYPE_STRING,"image/png", 0,10 );
pcSaveImage->Save(&vNewFile,"image/png");
vNewFile.Flush();
delete( pcSaveImage );
delete pcBitmapImage;
RemoveTimer(this,nID);
}
}