- Integration::Bitmap* bitmap = static_cast<Integration::Bitmap*>( resource.Get() );
-
- // Use bitmap->GetBufferOwnership() to transfer the buffer ownership to pixelData.
- // The destroy of bitmap will not release the buffer, instead, the pixelData is responsible for releasing when its reference count falls to zero.
- return Dali::PixelData::New( bitmap->GetBufferOwnership(),
- bitmap->GetBufferSize(),
- bitmap->GetImageWidth(),
- bitmap->GetImageHeight(),
- bitmap->GetPixelFormat(),
- Dali::PixelData::FREE );
+ Integration::BitmapPtr bitmap;
+ bool success = TizenPlatform::ImageLoader::ConvertStreamToBitmap( resourceType, url, fp, bitmap );
+ if( success && bitmap )
+ {
+ // Use bitmap->GetBufferOwnership() to transfer the buffer ownership
+ // to pixelData. The destroy of bitmap will not release the buffer,
+ // instead, the pixelBuffer is responsible for releasing when its
+ // reference count falls to zero.
+ Internal::Adaptor::PixelBufferPtr pixelBufferImpl =
+ Internal::Adaptor::PixelBuffer::New( bitmap->GetBufferOwnership(),
+ bitmap->GetBufferSize(),
+ bitmap->GetImageWidth(),
+ bitmap->GetImageHeight(),
+ bitmap->GetPixelFormat() );
+
+ Dali::Devel::PixelBuffer pixelBuffer( pixelBufferImpl.Get() );
+ return pixelBuffer;
+ }