Tizen Native API
6.5
|
ImageView is a class for displaying an image resource. More...
Classes | |
struct | Property |
Enumeration for the instance of properties belonging to the ImageView class. More... | |
Public Types | |
enum | PropertyRange |
Enumeration for the start and end property ranges for this control. More... | |
Public Member Functions | |
ImageView () | |
Creates an uninitialized ImageView. | |
~ImageView () | |
Destructor. | |
ImageView (const ImageView &imageView) | |
Copy constructor. | |
ImageView & | operator= (const ImageView &imageView) |
Assignment operator. | |
void | SetImage (Image image) DALI_DEPRECATED_API |
Sets this ImageView from an Image instance. | |
void | SetImage (const std::string &url) |
Sets this ImageView from the given URL. | |
void | SetImage (const std::string &url, ImageDimensions size) |
Sets this ImageView from the given URL. | |
Image | GetImage () const DALI_DEPRECATED_API |
Gets the Image instance handle used by the ImageView. | |
Static Public Member Functions | |
static ImageView | New () |
Create an initialized ImageView. | |
static ImageView | New (Image image) DALI_DEPRECATED_API |
Creates an initialized ImageView from an Image instance. | |
static ImageView | New (const std::string &url) |
Creates an initialized ImageView from an URL to an image resource. | |
static ImageView | New (const std::string &url, ImageDimensions size) |
Creates an initialized ImageView from a URL to an image resource. | |
static ImageView | DownCast (BaseHandle handle) |
Downcasts a handle to ImageView handle. |
Detailed Description
ImageView is a class for displaying an image resource.
An instance of ImageView can be created using a URL or an Image instance.
Some resources can be loaded before the ImageView is staged ( already cached ), in these cases if the connection to ResouceReadySignal is done after the resource is set then signal will be missed.
To protect against this, IsResourceReady() can be checked before connecting to ResourceReadySignal, or the signal connection can be done before setting the resource.
auto myImageView = ImageView::New( resourceUrl ); if ( myImageView.IsResourceReady() ) { // do something } else { myImageView.ResourceReadySignal.Connect( .... ) }
OR Connect to signal before setting resource
auto myImageView = ImageView::New(); myImageView.ResourceReadySignal.Connect( .... ) myImageView.SetProperty( ImageView::Property::IMAGE, resourceUrl );
- Since:
- 2.4, DALi version 1.0.0
Member Enumeration Documentation
Enumeration for the start and end property ranges for this control.
- Since:
- 2.4, DALi version 1.0.0
- Enumerator:
Reimplemented from Dali::Toolkit::Control.
Constructor & Destructor Documentation
Creates an uninitialized ImageView.
- Since:
- 2.4, DALi version 1.0.0
Destructor.
This is non-virtual since derived Handle types must not contain data or virtual methods.
- Since:
- 2.4, DALi version 1.0.0
Dali::Toolkit::ImageView::ImageView | ( | const ImageView & | imageView | ) |
Member Function Documentation
static ImageView Dali::Toolkit::ImageView::DownCast | ( | BaseHandle | handle | ) | [static] |
Downcasts a handle to ImageView handle.
If handle points to a ImageView, the downcast produces valid handle. If not, the returned handle is left uninitialized.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[in] handle Handle to an object
Reimplemented from Dali::Toolkit::Control.
Image Dali::Toolkit::ImageView::GetImage | ( | ) | const |
Gets the Image instance handle used by the ImageView.
- Deprecated:
- Deprecated since 3.0, DALi version 1.1.4
A valid handle will be returned only if this instance was created with New(Image) or SetImage(Image) was called.
- Since:
- 2.4, DALi version 1.0.0
static ImageView Dali::Toolkit::ImageView::New | ( | ) | [static] |
Create an initialized ImageView.
- Since:
- 2.4, DALi version 1.0.0
- Note:
- ImageView will not display anything.
Reimplemented from Dali::Toolkit::Control.
static ImageView Dali::Toolkit::ImageView::New | ( | Image | image | ) | [static] |
Creates an initialized ImageView from an Image instance.
- Deprecated:
- Deprecated since 3.0, DALi version 1.2.8, use New( const std::string& ) instead.
If the handle is empty, ImageView will not display anything.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[in] image The Image instance to display
- Returns:
- A handle to a newly allocated ImageView
static ImageView Dali::Toolkit::ImageView::New | ( | const std::string & | url | ) | [static] |
Creates an initialized ImageView from an URL to an image resource.
If the string is empty, ImageView will not display anything.
- Since:
- 2.4, DALi version 1.0.0
- Remarks:
- http://tizen.org/privilege/internet is needed if url is a http or https address.
- http://tizen.org/privilege/mediastorage is needed if url is relevant to media storage.
- http://tizen.org/privilege/externalstorage is needed if url is relevant to external storage.
- Parameters:
-
[in] url The url of the image resource to display
- Returns:
- A handle to a newly allocated ImageView
static ImageView Dali::Toolkit::ImageView::New | ( | const std::string & | url, |
ImageDimensions | size | ||
) | [static] |
Creates an initialized ImageView from a URL to an image resource.
If the string is empty, ImageView will not display anything.
- Since:
- 3.0, DALi version 1.1.10
- Remarks:
- http://tizen.org/privilege/internet is needed if url is a http or https address.
- http://tizen.org/privilege/mediastorage is needed if url is relevant to media storage.
- http://tizen.org/privilege/externalstorage is needed if url is relevant to external storage.
- Parameters:
-
[in] url The url of the image resource to display [in] size The width and height to which to fit the loaded image
- Returns:
- A handle to a newly allocated ImageView
- Note:
- A valid size is preferable for efficiency. However, do not set a size that is bigger than the actual image size, as up-scaling is not available. The content of the area not covered by the actual image is undefined and will not be cleared.
void Dali::Toolkit::ImageView::SetImage | ( | Image | image | ) |
Sets this ImageView from an Image instance.
- Deprecated:
- Deprecated since 3.0, DALi version 1.2.8, use SetImage( const std::string& ) instead.
If the handle is empty, ImageView will display nothing
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[in] image The Image instance to display.
void Dali::Toolkit::ImageView::SetImage | ( | const std::string & | url | ) |
Sets this ImageView from the given URL.
If the URL is empty, ImageView will not display anything.
- Since:
- 3.0, DALi version 1.1.4
- Remarks:
- http://tizen.org/privilege/internet is needed if url is a http or https address.
- http://tizen.org/privilege/mediastorage is needed if url is relevant to media storage.
- http://tizen.org/privilege/externalstorage is needed if url is relevant to external storage.
- Parameters:
-
[in] url The URL to the image resource to display
void Dali::Toolkit::ImageView::SetImage | ( | const std::string & | url, |
ImageDimensions | size | ||
) |
Sets this ImageView from the given URL.
If the URL is empty, ImageView will not display anything.
- Since:
- 3.0, DALi version 1.1.10
- Remarks:
- http://tizen.org/privilege/internet is needed if url is a http or https address.
- http://tizen.org/privilege/mediastorage is needed if url is relevant to media storage.
- http://tizen.org/privilege/externalstorage is needed if url is relevant to external storage.
- Parameters:
-
[in] url The URL to the image resource to display [in] size The width and height to fit the loaded image to