+ if(sourceHandle)
+ {
+ sourceVisual = DevelControl::GetVisual(GetImplementation(sourceHandle), Toolkit::ImageView::Property::IMAGE);
+ }
+
+ if(sourceVisual)
+ {
+ sourceVisual.CreatePropertyMap(sourceMap);
+ sourceMixColor = findValue(sourceMap, Dali::Toolkit::Visual::Property::MIX_COLOR);
+ sourceCornerRadius = findValue(sourceMap, Toolkit::DevelVisual::Property::CORNER_RADIUS);
+ }
+
+ std::vector<Dali::Property> properties;
+ std::vector<std::pair<Property::Value, Property::Value>> values;
+
+ if(Vector3(sourceMixColor) != Vector3(destinationMixColor))
+ {
+ properties.push_back(DevelControl::GetVisualProperty(destinationHandle, Toolkit::ImageView::Property::IMAGE, Toolkit::Visual::Property::MIX_COLOR));
+ values.push_back(std::make_pair(Vector3(sourceMixColor), Vector3(destinationMixColor)));
+ }
+ if(std::abs(sourceMixColor.a - destinationMixColor.a) > Math::MACHINE_EPSILON_1)
+ {
+ properties.push_back(DevelControl::GetVisualProperty(destinationHandle, Toolkit::ImageView::Property::IMAGE, Toolkit::Visual::Property::OPACITY));
+ values.push_back(std::make_pair(sourceMixColor.a, destinationMixColor.a));
+ }
+ if(sourceCornerRadius != destinationCornerRadius)
+ {
+ properties.push_back(DevelControl::GetVisualProperty(destinationHandle, Toolkit::ImageView::Property::IMAGE, Toolkit::DevelVisual::Property::CORNER_RADIUS));
+ values.push_back(std::make_pair(sourceCornerRadius, destinationCornerRadius));
+ }
+
+ for(uint32_t i = 0; i < properties.size(); ++i)
+ {
+ if(timePeriod.delaySeconds > 0.0f)
+ {
+ Dali::KeyFrames initialKeyframes = Dali::KeyFrames::New();
+ initialKeyframes.Add(0.0f, values[i].first);
+ initialKeyframes.Add(1.0f, values[i].first);
+ animation.AnimateBetween(properties[i], initialKeyframes, TimePeriod(timePeriod.delaySeconds));
+ }
+ Dali::KeyFrames keyframes = Dali::KeyFrames::New();
+ keyframes.Add(0.0f, values[i].first);
+ keyframes.Add(1.0f, values[i].second);
+ animation.AnimateBetween(properties[i], keyframes, alphaFunction, timePeriod);
+ }
+}
+
+void ImageView::OnResourceReady(Toolkit::Control control)
+{
+ // Visual ready so update visual attached to this ImageView, following call to RelayoutRequest will use this visual.
+ mVisual = DevelControl::GetVisual(*this, Toolkit::ImageView::Property::IMAGE);
+ // Signal that a Relayout may be needed
+}
+
+void ImageView::SetTransformMapForFittingMode(Vector2 finalSize, Vector2 naturalSize, Vector2 finalOffset, Visual::FittingMode fittingMode, Property::Map& transformMap)
+{
+ switch(fittingMode)
+ {
+ case Visual::FittingMode::FIT_KEEP_ASPECT_RATIO:
+ {
+ auto availableVisualSize = finalSize;