public class

ImageLabel

extends View
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.ui.ImageLabel

Class Overview

An ImageLabel represents an Image into Screen.

This class is used to display an Image

Default properties

By default, the scale type is STRETCH so when using method setStretchMode(int, int) the image inside the ImageLabel is resized according to the new stretch mode.
To prevent the behavior, the user has to set a different scale type.

See Also

Summary

XML Attributes
Attribute Name Related Method Description
image setImage(Image) Res.image.XXXX or a color  
[Expand]
Inherited XML Attributes
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
ImageLabel()
Constructs an Image label with no image attached
ImageLabel(Image image)
Constructs an image label with the image given
ImageLabel(int resId)
Constructs an image label with the image given
Public Methods
Image getImage()
Returns the current image of this label
void setImage(int resId)
Sets the image that will be displayed by this label
void setImage(Image image)
Sets the image that will be displayed by this label
void setImageScaleType(int scaleType)
Set the scale type for the image contained into this button.
[Expand]
Inherited Methods
From class com.neomades.ui.View
From class java.lang.Object

XML Attributes

image

Res.image.XXXX or a color

Related Methods

Public Constructors

public ImageLabel ()

Constructs an Image label with no image attached

public ImageLabel (Image image)

Constructs an image label with the image given

Parameters
image the image to attach to this ImageLabel

public ImageLabel (int resId)

Constructs an image label with the image given

Parameters
resId the image id attached to this image label

Public Methods

public Image getImage ()

Returns the current image of this label

Related XML Attributes
Returns
  • the current image

public void setImage (int resId)

Sets the image that will be displayed by this label

Related XML Attributes
Parameters
resId the image id attached to this image label
Throws
CrossThreadException if the method is called from outside the UI-Thread

public void setImage (Image image)

Sets the image that will be displayed by this label

Related XML Attributes
Parameters
image the image to display
Throws
CrossThreadException if the method is called from outside the UI-Thread

public void setImageScaleType (int scaleType)

Set the scale type for the image contained into this button.

By default, the scale type is STRETCH.

Parameters
scaleType the scale type to apply to the image of the ImageLabel
See Also