| 443 | } |
| 444 | |
| 445 | bool Tr2HostBitmap::Save( const wchar_t* path ) |
| 446 | { |
| 447 | CCP_STATS_ZONE( __FUNCTION__ ); |
| 448 | |
| 449 | if( !IsValid() ) |
| 450 | { |
| 451 | CCP_LOGWARN( "Tr2HostBitmap::Save not a valid bitmap" ); |
| 452 | return false; |
| 453 | } |
| 454 | |
| 455 | Be::Clsid resFileClsid( "blue", "ResFile" ); |
| 456 | IResFilePtr stream( resFileClsid ); |
| 457 | if( !( stream->FileExistsW( path ) ? stream->OpenW( path, false ) : stream->CreateW( path ) ) ) |
| 458 | { |
| 459 | CCP_LOGWARN( "Tr2HostBitmap::Save failed to open Blue stream (%S)", path ); |
| 460 | return false; |
| 461 | } |
| 462 | ON_BLOCK_EXIT( [&] { stream->Close(); } ); |
| 463 | |
| 464 | return ImageIO::SaveImage( path, *this, *stream ); |
| 465 | } |
| 466 | |
| 467 | bool Tr2HostBitmap::SaveAsync( const wchar_t* path ) |
| 468 | { |