Guiliani  Version 2.6 revision 7293 (documentation build 12)
CGUIImage Class Reference

Displays a static image in the GUI. More...

#include <GUIImage.h>

Inheritance diagram for CGUIImage:

Public Types

enum  BlitType_t { IBT_CENTER , IBT_STRETCH , IBT_TILED }
 enum for blitting-type More...
 
- Public Types inherited from CGUIObject
enum  FourWayFocus_t { FOCUS_LEFT , FOCUS_RIGHT , FOCUS_UP , FOCUS_DOWN }
 

Public Member Functions

 CGUIImage ()
 
 CGUIImage (CGUICompositeObject *const pkParent, const CGUIRect &kRect, const ImageResource_t &eImageID, const eC_Bool &bStretchBlit=true, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIImage (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ImageResource_t &eImageID, const eC_Bool &bStretchBlit=true, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIImage (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const ImageResource_t &eImageID, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIImage (const CGUIImage &kSource)
 
virtual eC_Bool DoDraw ()
 
BlitType_t GetBlitType () const
 
ImageResource_t GetImageID () const
 
CGUINinePatchGetNinePatch ()
 
eC_Bool GetStretchBlit () const
 
virtual eC_Bool IsHighlightable () const
 
CGUIImageoperator= (const CGUIImage &kSource)
 
virtual void ReadFromStream ()
 
void SetBlitType (const BlitType_t &eBlitType)
 
void SetImage (const ImageResource_t &eImage, const eC_Bool &bFitToImage=false)
 
void SetStretchBlit (eC_Bool bStretchBlit)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIObject
 CGUIObject ()
 
 CGUIObject (CGUICompositeObject *const pkParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject (const CGUIObject &kSource)
 
virtual ~CGUIObject ()
 
void AddValueObserver (CGUIObserver *pkObserver)
 
eC_Bool CalculateInvalidatedRect (CGUIRect &rRect) const
 
virtual eC_Bool ClaimFocus ()
 
virtual void CreateSnapshot (eC_UInt uiBackColor=0x00)
 
eC_Bool DataPoolConnectorExists () const
 
void DeleteSnapshot ()
 
virtual void DisableSnapshotDrawing (eC_Bool bDeleteSnapshot=true)
 
virtual eC_Bool DoDraw ()
 
virtual eC_Bool DoDrawSnapshot ()
 
virtual void EnableSnapshotDrawing ()
 
virtual CGUIObjectFindObject (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool FocusAny ()
 
virtual eC_Bool FocusNext (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
virtual eC_Bool FocusPrevious (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
CGUIRect GetAbsRect () const
 
eC_Value GetAbsXPos () const
 
eC_Value GetAbsXPosCenter () const
 
eC_Value GetAbsXPosREdge () const
 
eC_Value GetAbsYPos () const
 
eC_Value GetAbsYPosBEdge () const
 
eC_Value GetAbsYPosCenter () const
 
eC_UByte GetAlpha () const
 
CGUIBehaviourDecoratorGetBehaviour ()
 
const CGUIBehaviourDecoratorGetBehaviour () const
 
GUIBitmapPlaneID_t GetBitmapID () const
 
CGUIBitmapPlaneGetBitmapPlane () const
 
CGUIRect GetCurrentAbsRect () const
 
eC_Value GetCurrentAbsXPos () const
 
eC_Value GetCurrentAbsXPosCenter () const
 
eC_Value GetCurrentAbsXPosREdge () const
 
eC_Value GetCurrentAbsYPos () const
 
eC_Value GetCurrentAbsYPosBEdge () const
 
eC_Value GetCurrentAbsYPosCenter () const
 
CDataPoolConnectorGetDataPoolConnector ()
 
eC_Value GetDistanceBottom () const
 
eC_Value GetDistanceRight () const
 
eC_Value GetHalfHeight () const
 
eC_Value GetHalfWidth () const
 
eC_Value GetHeight () const
 
ObjectHandle_t GetID () const
 
CGUILayouterGetLayouter ()
 
const CGUILayouterGetLayouter () const
 
ObjectHandle_t GetNeighborBottomID () const
 
ObjectHandle_t GetNeighborLeftID () const
 
ObjectHandle_t GetNeighborRightID () const
 
ObjectHandle_t GetNeighborTopID () const
 
CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false)
 
const CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) const
 
CGUIRect GetOriginRect () const
 
CGUICompositeObjectGetParent ()
 
const CGUICompositeObjectGetParent () const
 
CGUIRect GetRelRect () const
 
eC_Value GetRelXPos () const
 
eC_Value GetRelXPosCenter () const
 
eC_Value GetRelXPosREdge () const
 
eC_Value GetRelYPos () const
 
eC_Value GetRelYPosBEdge () const
 
eC_Value GetRelYPosCenter () const
 
UUID_t GetUUID () const
 
eC_Value GetWidth () const
 
void InvalidateArea ()
 
eC_Bool IsClickable () const
 
eC_Bool IsClickThrough () const
 
virtual eC_Bool IsCompositeObject () const
 
eC_Bool IsDescendantOf (const CGUIObject *const pAncestor) const
 
eC_Bool IsDisabled () const
 
eC_Bool IsDragable () const
 
eC_Bool IsDragged () const
 
eC_Bool IsDrawingSnapshot () const
 
eC_Bool IsFocussable () const
 
eC_Bool IsFocussed () const
 
eC_Bool IsGrayedOut () const
 
virtual eC_Bool IsHighlightable () const
 
eC_Bool IsHighlighted () const
 
eC_Bool IsInvisible () const
 
eC_Bool IsPressed () const
 
eC_Bool IsStopFocus () const
 
void NotifyValueObservers (const CGUIValue &kValue, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
CGUIObjectoperator= (const CGUIObject &kSource)
 
virtual void ReadFromStream ()
 
virtual void RefreshLayout (CGUILayouter::eMovedEdges_t eMovedEdges) const
 
void RemoveValueObserver (CGUIObserver *pkObserver)
 
void RenderToBitmap (eC_UInt uiBitmapID, eC_Value vXOffset=eC_FromInt(0), eC_Value vYOffset=eC_FromInt(0))
 
eC_Bool RequestFocus ()
 
void SetAlpha (eC_UByte ubAlpha)
 
void SetBehaviour (CGUIBehaviourDecorator *pkBehaviour)
 
void SetClickThrough (const eC_Bool &bClickThrough)
 
virtual void SetDisabled (const eC_Bool &bDisabled)
 
virtual void SetFocussable (const eC_Bool &bFocussable)
 
virtual void SetGrayedOut (const eC_Bool &bGrayOut)
 
virtual void SetHeight (const eC_Value &vY)
 
void SetID (const ObjectHandle_t &eID)
 
virtual void SetInvisible (const eC_Bool &bInvisible)
 
void SetLayouter (CGUILayouter *pLayouter)
 
void SetNeighborBottomID (const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborIDs (const ObjectHandle_t eNewNeighborLeftID, const ObjectHandle_t eNewNeighborRightID, const ObjectHandle_t eNewNeighborTopID, const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborLeftID (const ObjectHandle_t eNewNeighborLeftID)
 
void SetNeighborRightID (const ObjectHandle_t eNewNeighborRightID)
 
void SetNeighborTopID (const ObjectHandle_t eNewNeighborTopID)
 
virtual void SetParent (CGUICompositeObject *const pkParent)
 
void SetRelRect (const CGUIRect &kNewRect)
 
virtual void SetRelXPos (const eC_Value &vX)
 
void SetRelXPosCenter (const eC_Value &vXCenter)
 
void SetRelXPosREdge (const eC_Value &vX)
 
virtual void SetRelYPos (const eC_Value &vY)
 
void SetRelYPosBEdge (const eC_Value &vY)
 
void SetRelYPosCenter (const eC_Value &vYCenter)
 
void SetStopFocus (const eC_Bool &bDontFocusToParent)
 
void SetUUID (const UUID_t &kUUID)
 
virtual eC_Bool SetValue (CDataPoolEntry &rkValue)
 
virtual eC_Bool SetValue (const CGUIValue &rkValue)
 
virtual void SetWidth (const eC_Value &vX)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIBehaviour
virtual eC_Bool DoScale (const eC_Value &vDelta)
 
virtual eC_Bool DoUserEvent (CGUIEvent *const pEvent)
 
virtual void OnCreate ()
 
virtual void OnDataPool (const DataPoolResource_t &eID)
 
virtual void OnDelete ()
 
virtual void OnHide ()
 
virtual void OnShow ()
 
virtual eC_Bool DoClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoLongClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDoubleClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoButtonDown (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoButtonUp (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDrag (const eC_Value &vDeltaX=eC_FromInt(-1), const eC_Value &vDeltaY=eC_FromInt(-1), const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDragEnd (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseEnter (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseLeave (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseMove (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual void GetFocus ()
 
virtual void LoseFocus ()
 
virtual eC_Bool Decrease ()
 
virtual eC_Bool Increase ()
 
virtual eC_Bool DoKeyDown (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoScroll (const eC_Value &vAbsX, const eC_Value &vAbsY, const eC_Value &vDelta, const eC_Bool &bModifierActive)
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
virtual void ReadFromStream ()
 
void SetXMLTag (const eC_String &kXMLTag)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
virtual eC_Bool IsAnimating () const
 
virtual void StartAnimation ()
 
virtual void StopAnimation ()
 

Additional Inherited Members

- Static Public Member Functions inherited from CGUIStreamableObject
static UUID_t GenerateUUID ()
 
- Static Public Attributes inherited from CGUIObject
static const eC_Char XMLTAG_ALPHA []
 XML tag to be used writing alpha-value into a stream.
 
static const eC_Char XMLTAG_CLICKTHROUGH []
 XML tag to be used writing clickthrough-state into a stream.
 
static const eC_Char XMLTAG_CONTROLCLASSID []
 XML tag to be used when writing a control class ID into a stream.
 
static const eC_Char XMLTAG_DISABLED []
 XML tag to be used writing disabled-state into a stream.
 
static const eC_Char XMLTAG_FOCUSSABLE []
 XML tag to be used writing focussable-state into a stream.
 
static const eC_Char XMLTAG_GRAYEDOUT []
 XML tag to be used writing grayedout-state into a stream.
 
static const eC_Char XMLTAG_HEIGHT []
 XML tag to be used writing height into a stream.
 
static const eC_Char XMLTAG_INVISIBLE []
 XML tag to be used writing invisible-state into a stream.
 
static const eC_Char XMLTAG_OBJECTID []
 XML tag to be used writing object id into a stream.
 
static const eC_Char XMLTAG_OVERRIDDENNEIGHBORS []
 XML tag to be used writing overridden neighbors into a stream.
 
static const eC_Char XMLTAG_UUID []
 XML tag to be used when writing a UUID into a stream.
 
static const eC_Char XMLTAG_WIDTH []
 XML tag to be used writing width into a stream.
 
static const eC_Char XMLTAG_XPOS []
 XML tag to be used writing x-position into a stream.
 
static const eC_Char XMLTAG_YPOS []
 XML tag to be used writing y-position into a stream.
 
- Static Public Attributes inherited from CGUIBehaviour
static const eC_Char XMLTAG_BEHAVIOURCLASSID []
 XML tag to be used when writing a behaviour class ID into a stream.
 
static const eC_Char XMLTAG_BEHAVIOURCOUNT []
 XML tag for count.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION []
 
- Protected Member Functions inherited from CGUIObject
virtual eC_Bool CreateBitmapPlane ()
 
virtual eC_Bool FourWayNext (FourWayFocus_t eFocusDirection)
 
- Protected Member Functions inherited from CGUIStreamableObject
eC_UInt ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const
 
void WriteStreamingFooter (const eC_Bool &bWriteClassID) const
 
void WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const
 
- Protected Attributes inherited from CGUIObject
UUID_t m_kUUID
 UUID of object.
 

Detailed Description

Displays a static image in the GUI.

The "image" control is used to display a static image. The position and dimension of the image can be set freely. The scaling of the images is arbitrary in x and y dimension - so the aspect ratio can be changed. The "image" control is typically used to display e.g., a background image or brand icons (Class: CGUIImage).

This control displays an image. The image can be stretched if the control size does not match the image size.

Example:

// Create an image.
CGUIImage* pkImage = new CGUIImage(this,
eC_FromInt(0), eC_FromInt(0),
eC_FromInt(30), eC_FromInt(30),
IMG_IMAGE1,
true,
OBJ_IMAGE);
// Set image.
// Before calling this method, please add image id to UserImageResource.h.
// After that call GETRESMANAGER.RegisterImageResource() to register an image for image id.
pkImage->SetImage(IMG_IMAGE2,true);
// Sets the alpha (transparency) value of the image
pkImage->SetAlpha(12);
Displays a static image in the GUI.
Definition: GUIImage.h:59
void SetImage(const ImageResource_t &eImage, const eC_Bool &bFitToImage=false)
void SetAlpha(eC_UByte ubAlpha)

Member Enumeration Documentation

◆ BlitType_t

enum for blitting-type

Enumerator
IBT_STRETCH 

blit image in center

IBT_TILED 

stretch image to fit

tile image to fit

Constructor & Destructor Documentation

◆ CGUIImage() [1/5]

CGUIImage::CGUIImage ( CGUICompositeObject *const  pkParent,
const eC_Value &  vX,
const eC_Value &  vY,
const eC_Value &  vWidth,
const eC_Value &  vHeight,
const ImageResource_t eImageID,
const eC_Bool &  bStretchBlit = true,
const ObjectHandle_t eID = NO_HANDLE 
)

Constructs a CGUIImage object. Note that if the given width and height do not match the actual size of the image it will be stretched when drawing it, resulting in a potential performance loss.

Parameters
pkParentPointer to the parent object of this image.
vXThe x coordinate of the upper left corner of this image.
vYThe y coordinate of the upper left corner of this image.
vWidthThe width of this image.
vHeightThe height of this image.
eImageIDThe ID of the image represented by this object.
eIDThis image's object ID.
bStretchBlitIf true image will be stretched to the size of the object, if false image will be centered.

◆ CGUIImage() [2/5]

CGUIImage::CGUIImage ( CGUICompositeObject *const  pkParent,
const CGUIRect kRect,
const ImageResource_t eImageID,
const eC_Bool &  bStretchBlit = true,
const ObjectHandle_t eID = NO_HANDLE 
)

Constructs a CGUIImage object. Note that if the given width and height do not match the actual size of the image it will be stretched when drawing it, resulting in a potential performance loss.

Parameters
pkParentPointer to the parent object of this image.
kRectThe bounding rectangle, relative to parent.
eImageIDThe ID of the image represented by this object.
eIDThis image's object ID.
bStretchBlitIf true image will be stretched to the size of the object, if false image will be centered.

◆ CGUIImage() [3/5]

CGUIImage::CGUIImage ( CGUICompositeObject *const  pkParent,
const eC_Value &  vX,
const eC_Value &  vY,
const ImageResource_t eImageID,
const ObjectHandle_t eID = NO_HANDLE 
)

Constructs a CGUIImage object and determines its size by the image.

Parameters
pkParentPointer to the parent object of this image.
vXThe x coordinate of the upper left corner of this image.
vYThe y coordinate of the upper left corner of this image.
eImageIDThe ID of the image represented by this object. The size of this object is initialized with the dimensions of the image.
eIDThis image's object ID.

◆ CGUIImage() [4/5]

CGUIImage::CGUIImage ( const CGUIImage kSource)

Copy-constructor of the CGUIImage class.

Parameters
kSourceSource object to be copied.

◆ CGUIImage() [5/5]

CGUIImage::CGUIImage ( )

Standard constructor.

See also
CGUIObject().

Member Function Documentation

◆ DoDraw()

virtual eC_Bool CGUIImage::DoDraw ( )
virtual

Visualizes the object. It is forbidden to call SetRelXPos, SetRelYPos, SetWidth or SetHeight in DoDraw, i.e., it is not allowed to change the layout.

Returns
True if anything was drawn, False otherwise

Reimplemented from CGUIObject.

Reimplemented in CGUIAnimatedImage, and CGUIImageStack.

◆ GetBlitType()

BlitType_t CGUIImage::GetBlitType ( ) const

Get currently used blitting-type

Returns
blitting-type

◆ GetImageID()

ImageResource_t CGUIImage::GetImageID ( ) const

Get the ImageID.

Returns
ImageID

◆ GetNinePatch()

CGUINinePatch & CGUIImage::GetNinePatch ( )

Returns the nine-patch for direct modification

Returns
nine-patch

◆ GetStretchBlit()

eC_Bool CGUIImage::GetStretchBlit ( ) const

Sets the stretch blit attribute of the image

Returns
True if image will be stretched

◆ IsHighlightable()

virtual eC_Bool CGUIImage::IsHighlightable ( ) const
inlinevirtual

This method checks if an object is highlightable. This refers to whether it can be highlighted via the event handler. If true the event handler may mark this object as the currently highlighted one. Thus, there is no special flag in CGUIObject that determines if an object is highlightable. The default determination is that the control is in none of the following states:

  • invisible
  • grayed-out
  • disabled if so the return value will be true. NOTE: when an object is not highlightable, it will never receive DoMouseEnter and DoMouseLeave-events
    Returns
    True if highlightable, False otherwise

Reimplemented from CGUIObject.

◆ operator=()

CGUIImage & CGUIImage::operator= ( const CGUIImage kSource)

Operator= method of the CGUIImage class.

Parameters
kSourceSource object to be copied.
Returns
Copied object.

◆ ReadFromStream()

virtual void CGUIImage::ReadFromStream ( )
virtual

Reads all object attributes from streaming file. Only for use with GUIFactory. GUIStreamingFileReader has to be set in CGUI::Init().

See also
CGUIFactory

Reimplemented from CGUIObject.

Reimplemented in CGUIAnimatedImage, and CGUIImageStack.

◆ SetBlitType()

void CGUIImage::SetBlitType ( const BlitType_t eBlitType)

Sets the type of blitting for the image

Parameters
eBlitTypetpye of blitting

◆ SetImage()

void CGUIImage::SetImage ( const ImageResource_t eImage,
const eC_Bool &  bFitToImage = false 
)

Sets the ID of the image that will be drawn by this control.

Parameters
eImageAn image ID. If it is the same ID as the current one, this method does nothing.
bFitToImageSpecifies whether the CGUIImage object shall be automatically resized to match the given image's dimensions.

◆ SetStretchBlit()

void CGUIImage::SetStretchBlit ( eC_Bool  bStretchBlit)

Sets the stretch blit attribute of the image

Parameters
bStretchBlitSpecifies whether the CGUIImage object shall be automatically resized to match the given image's dimensions.

◆ WriteToStream()

virtual void CGUIImage::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

Writes all object attributes to the streaming file. StreamWriter has to be initialized. Only for use with GUIStreamWriter.

Parameters
bWriteClassIDThis flag is used to select if writing of ControlID, leading and trailing tags is performed. Only GUIStreamWriter and GUICompositeObject have to set this flag true.
See also
CGUIStreamWriter

Reimplemented from CGUIObject.

Reimplemented in CGUIAnimatedImage, and CGUIImageStack.


The documentation for this class was generated from the following file: