-void ImageView::SetImage( Image image )
-{
- // Don't bother comparing if we had a visual previously, just drop old visual and create new one
- mImage = image;
- mUrl.clear();
- mPropertyMap.Clear();
-
- Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
- if( visual )
- {
- if( !mVisual )
- {
- mVisual = visual;
- }
-
- if( !mShaderMap.Empty() )
- {
- Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
- visualImpl.SetCustomShader( mShaderMap );
- }
-
- DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual );
- }
- else
- {
- // Unregister the existing visual
- DevelControl::UnregisterVisual( *this, Toolkit::ImageView::Property::IMAGE );
-
- // Trigger a size negotiation request that may be needed when unregistering a visual.
- RelayoutRequest();
- }
-
- // Signal that a Relayout may be needed
-}
-