10-07-2012 03:00 PM
Is there a way to change the alpha of my image view? Also is there a way to set it's width and height?
Thanks!
10-07-2012 03:17 PM
There is a way!
To change the alpha us the opacity property which takes values from 0.0 to 1.0
ImageView{
id: awesomeImage
imageSource: "location/of/image.png"
opacity: 0.5
}
To change width/height use preferredWidth and preferredHeight
ImageView{
id: awesomeImage
imageSource: "location/of/image.png"
opacity: 0.5
preferredWidth: 500
preferredHeight: 800
}
Its that simple. ![]()
10-07-2012 03:20 PM
Sorry, forgot to mention, I need it in C++, I'm not using QML.
10-07-2012 03:55 PM
In C++ you would do this:
header include
#include <bb/cascades/ImageView>
the C++ code
ImageView *imageView = new ImageView();
imageView->preferredHeight(500);
imageView->preferredWidth(800);
imageView->opacity(0.5);
imageView->setImage(Image("location/of/image.png") );
![]()