ImageView FittingMode is not working
Closed this issue · 2 comments
Ali-Alzyoud commented
I notice that setting fitting mode for image View is not working, if it was set like:
Property::Map imageMap;
imageMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
imageMap[ ImageVisual::Property::URL ] = "img.png";
imageMap[ ImageVisual::Property::FITTING_MODE ] = FittingMode::FIT_WIDTH;//Aspect Ratio is messed up
mImageView.SetProperty(ImageView::Property::IMAGE, imageMap);
but if fitting mode is set like this it will work just fine:
Property::Map imageMap;
imageMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
imageMap[ ImageVisual::Property::URL ] = "img.png";
imageMap[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::FIT_WIDTH;//Aspect Ratio is preserved
mImageView.SetProperty(ImageView::Property::IMAGE, imageMap);
This project could be used to show the issue:
https://github.com/Ali-Alzyoud/dali_image_app
Ali-Alzyoud commented
@adeelkazmi @DavidIanSteele
Am I missing something when using Image Fit Mode?
adeelkazmi commented
Hi Ali, I think use the latter solution. The first one is more about loading and from memory it's just the texture that is provided which is then manipulated by the toolkit anyway so is a bit unreliable.