-/**
- * Creates an ImageView
- *
- * @param[in] filename The path of the image.
- * @param[in] width The width of the image in pixels.
- * @param[in] height The height of the image in pixels.
- * @param[in] fittingMode The mode to use when scaling the image to fit the desired dimensions.
- */
-ImageView CreateImageView(const std::string& filename, unsigned int width, unsigned int height, Dali::FittingMode::Type fittingMode )
-{
- Image img = CreateImage( filename, width, height, fittingMode );
- ImageView actor = ImageView::New( img );
- actor.SetName( filename );
- actor.SetParentOrigin(ParentOrigin::CENTER);
- actor.SetAnchorPoint(AnchorPoint::CENTER);
+ Property::Map map;
+ map[Toolkit::ImageVisual::Property::URL] = filename;
+ map[Toolkit::ImageVisual::Property::DESIRED_WIDTH] = width;
+ map[Toolkit::ImageVisual::Property::DESIRED_HEIGHT] = height;
+ map[Toolkit::ImageVisual::Property::FITTING_MODE] = fittingMode;
+ imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
+
+ imageView.SetName( filename );
+ imageView.SetParentOrigin(ParentOrigin::CENTER);
+ imageView.SetAnchorPoint(AnchorPoint::CENTER);