| 38 | } |
| 39 | |
| 40 | void ImageFileBasicApp::openImage( const fs::path &path ) |
| 41 | { |
| 42 | try { |
| 43 | mImagePath = path; |
| 44 | mImageSource = loadImage( path ); |
| 45 | mTexture = gl::Texture::create( mImageSource ); |
| 46 | mCanvas.setContentBounds( Rectf( mTexture->getBounds() ) ); |
| 47 | mCanvas.fitAll(); |
| 48 | mErrorMessage.clear(); |
| 49 | } |
| 50 | catch( Exception &exc ) { |
| 51 | CI_LOG_EXCEPTION( "failed to load image.", exc ); |
| 52 | mTexture.reset(); |
| 53 | mImageSource.reset(); |
| 54 | mImagePath.clear(); |
| 55 | mErrorMessage = exc.what(); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | void ImageFileBasicApp::openImageDialog() |
| 60 | { |