- Constraint constraint = Constraint::New<float>( mPropertyDetail,
- LocalSource( Actor::WORLD_POSITION ),
- Source( camera, Actor::WORLD_POSITION ),
- CameraDetailConstraint(detailFactor));
- Self().RemoveConstraints();
- Self().ApplyConstraint(constraint);
+ Toolkit::ImageView imageView = Toolkit::ImageView::DownCast( Dali::BaseHandle( object ) );
+
+ if ( imageView )
+ {
+ ImageView& impl = GetImpl( imageView );
+ switch ( index )
+ {
+ case Toolkit::ImageView::Property::RESOURCE_URL:
+ {
+ std::string imageUrl;
+ if( value.Get( imageUrl ) )
+ {
+ impl.SetImage( imageUrl, ImageDimensions() );
+ }
+ break;
+ }
+
+ case Toolkit::ImageView::Property::IMAGE:
+ {
+ std::string imageUrl;
+ Property::Map* map;
+ if( value.Get( imageUrl ) )
+ {
+ impl.SetImage( imageUrl, ImageDimensions() );
+ }
+ // if its not a string then get a Property::Map from the property if possible.
+ else
+ {
+ map = value.GetMap();
+ if( map )
+ {
+ Property::Value* shaderValue = map->Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
+ // set image only if property map contains image information other than custom shader
+ if( map->Count() > 1u || !shaderValue )
+ {
+ impl.SetImage( *map );
+ }
+ // the property map contains only the custom shader
+ else if( ( impl.mVisual )&&( map->Count() == 1u )&&( shaderValue ) )
+ {
+ Property::Map* shaderMap = shaderValue->GetMap();
+ if( shaderMap )
+ {
+ Internal::Visual::Base& visual = Toolkit::GetImplementation( impl.mVisual );
+ visual.SetCustomShader( *shaderMap );
+ if( imageView.OnStage() )
+ {
+ // force to create new core renderer to use the newly set shader
+ visual.SetOffStage( imageView );
+ visual.SetOnStage( imageView );
+ }
+ }
+ }
+ }
+ }
+ break;
+ }
+
+ case Toolkit::ImageView::Property::PRE_MULTIPLIED_ALPHA:
+ {
+ bool isPre;
+ if( value.Get( isPre ) )
+ {
+ impl.EnablePreMultipliedAlpha( isPre );
+ }
+ break;
+ }
+ }
+ }