class CAlfImageVisual : public CAlfVisual |
Image visual displays an image.
An image visual can be used to display portions of CAlfTextures on the UI. Crossfading between two images in a single image visual is possible. The secondaryAlpha property controls the blending between the primary and secondary images of the visual. The default value is 0.0, which results in only the primary image being drawn. The secondary image is ignored when doing scaling calculations.
//Create image visual and set image //It will set primary image for imagevisual CAlfImageVisual* imagevisual = CAlfImageVisual::AddNewL( control ); imagevisual->SetImage( iImage ); //Set secondary image and alpha value for crossfading imagevisual->SetSecondaryImage( iImage2 ); imagevisual->SetSecondaryAlpha( 0.5 );TAlfImage CAlfTexturealfclient.lib
Public Member Functions | |
---|---|
CAlfImageVisual () | |
~CAlfImageVisual () | |
IMPORT_C CAlfImageVisual * | AddNewL ( CAlfControl &, CAlfLayout *) |
IMPORT_C void | ConstructL ( CAlfControl &) |
IMPORT_C CAlfVisual * | FindTag (const TDesC8 &) |
IMPORT_C const TAlfImage & | Image () |
IMPORT_C TAlfTimedPoint | Offset () |
IMPORT_C void | RemoveAndDestroyAllD () |
IMPORT_C TAlfTimedValue | Scale () |
IMPORT_C CAlfImageVisual::TScaleMode | ScaleMode () |
IMPORT_C TAlfTimedValue | SecondaryAlpha () |
IMPORT_C const TAlfImage & | SecondaryImage () |
IMPORT_C void | SetColor (const TRgb &) |
IMPORT_C void | SetColorMode ( CAlfImageVisual::TColorMode , TReal32 ) |
IMPORT_C void | SetDropShadow ( TInt ) |
IMPORT_C void | SetDropShadow (const TAlfMetric &) |
IMPORT_C void | SetDropShadow (const TAlfXYMetric &) |
IMPORT_C void | SetImage (const TAlfImage &) |
IMPORT_C void | SetOffset (const TAlfTimedPoint &) |
IMPORT_C void | SetScale (const TAlfTimedValue &) |
IMPORT_C void | SetScaleMode ( CAlfImageVisual::TScaleMode ) |
IMPORT_C void | SetSecondaryAlpha (const TAlfTimedValue &) |
IMPORT_C void | SetSecondaryImage (const TAlfImage &) |
IMPORT_C void | SetStretch ( TInt , TInt ) |
IMPORT_C void | SetStretchMode (CAlfGc::TStretchMode) |
IMPORT_C void | SetTurnAngle (const TAlfTimedValue &) |
IMPORT_C TAlfTimedValue | TurnAngle () |
IMPORT_C void | UpdateChildrenLayout ( TInt ) |
Protected Member Functions | |
---|---|
IMPORT_C void | DoRemoveAndDestroyAllD () |
IMPORT_C void | PropertyOwnerExtension (const TUid &, TAny **) |
Public Member Enumerations | |
---|---|
enum | TColorMode { EColorModulate , EColorDimmed } |
enum |
TScaleMode
{
EScaleNormal , EScaleFitWidth , EScaleFitHeight , EScaleCover , EScaleFit , EScaleFitInside } |
Private Attributes | |
---|---|
TImageVisualPrivateData * | iImageVisualData |
IMPORT_C CAlfImageVisual * | AddNewL | ( | CAlfControl & | aOwnerControl, |
CAlfLayout * | aParentLayout = 0 | |||
) | [static] |
Constructs and appends a new image visual to the owner control.
CAlfControl & aOwnerControl | Control that will own the new visual. |
CAlfLayout * aParentLayout = 0 |
IMPORT_C void | ConstructL | ( | CAlfControl & | aOwner | ) | [virtual] |
Second-phase constructor, from CAlfVisual
CAlfControl & aOwner |
IMPORT_C void | DoRemoveAndDestroyAllD | ( | ) | [protected, virtual] |
From CAlfVisual CAlfVisual
IMPORT_C CAlfVisual * | FindTag | ( | const TDesC8 & | aTag | ) | [virtual] |
Finds a visual whose tag descriptor contains a specific tag.
CAlfVisual::FindTag() is the basic implementation that checks if this visual's tag matches the specified tag. CAlfLayout::FindTag() extends the search into child visuals, covering recursively entire visual hierarchies.
Todo: how should several visuals with matching tag to be handled ??
CAlfVisual::Tag() CAlfVisual::SetTagL() CAlfVisual::IsTagged() CAlfLayout::FindTag()
const TDesC8 & aTag | Tag to look for. If this tag is found as a part of a visual's colon-separated tag descriptor, it is treated as a match and the visual is returned. The tag to look for cannot contain separator characters (:). |
IMPORT_C void | PropertyOwnerExtension | ( | const TUid & | aExtensionUid, |
TAny ** | aExtensionParams | |||
) | [protected, virtual] |
! future proofing
IMPORT_C CAlfImageVisual::TScaleMode | ScaleMode | ( | ) |
Gets the scaling mode of the Image Visual texture. Returns the Scalemode set to Image Visual, using SetScaleMode() Default is EScaleFit.
IMPORT_C const TAlfImage & | SecondaryImage | ( | ) | const |
Returns the secondary image of the visual.
IMPORT_C void | SetColor | ( | const TRgb & | aColor | ) |
Sets the color of the image. Defaults to white.
const TRgb & aColor |
IMPORT_C void | SetColorMode | ( | CAlfImageVisual::TColorMode | aColorMode, |
TReal32 | aParam = 0.0 | |||
) |
Sets the color mode of the image. Defaults to modulate.
CAlfImageVisual::TColorMode aColorMode | Color mode. |
TReal32 aParam = 0.0 | Parameter for the mode. With blend, specifies the amount of color to blend (0...1). 1.0 will cause the image to be fully blended to the visual's color. |
IMPORT_C void | SetDropShadow | ( | TInt | aShadowDistance | ) |
Use CAlfDropShadow
Sets the drop shadow distance.
Use metric unit version instead.
TInt aShadowDistance | Pixels. |
IMPORT_C void | SetDropShadow | ( | const TAlfMetric & | aShadowDistance | ) |
Use CAlfDropShadow
Sets the drop shadow distance.
const TAlfMetric & aShadowDistance | Set shadow distance in metric units. Both X and Y will use this value. |
IMPORT_C void | SetDropShadow | ( | const TAlfXYMetric & | aShadowDistance | ) |
Use CAlfDropShadow
Sets the drop shadow distance.
const TAlfXYMetric & aShadowDistance | Set shadow distance in metric units. |
IMPORT_C void | SetImage | ( | const TAlfImage & | aImage | ) |
Sets the image displayed by the image visual. If no image has been set for the visual, the visual does not draw anything.
You may call SetImage also with images(/textures) that have not been loaded (yet). The toolkit has been designed so that SetImage() can be called before the texture has been finished loading. In the meantime, a placeholder could be used. In other words, the CAlfTexture that the TAlfImage refers to does need to exist but it doesn't have to be loaded yet.
Redrawing of the visual happens automatically after SetImage() has been called.
Redrawing also happens automatically when a texture has been fully loaded by the texture manager. The manager notifies the environment, which issues a full display redraw.
const TAlfImage & aImage | Primary image to be visualized. |
IMPORT_C void | SetOffset | ( | const TAlfTimedPoint & | aOffset | ) |
Sets relative offset for scaled images.
const TAlfTimedPoint & aOffset | relative offset |
IMPORT_C void | SetScale | ( | const TAlfTimedValue & | aScale | ) |
Sets uniform scale factor for the image.
const TAlfTimedValue & aScale | Scale factor |
IMPORT_C void | SetScaleMode | ( | CAlfImageVisual::TScaleMode | aScaleMode | ) |
Sets the scaling mode for the bitmap. An unscaled image will be drawn at a 1:1 mapping between its texture and the screen. A scaled image will be resized to fit the visual's size exactly. If unset, the default is EScaleFit.
CAlfImageVisual::TScaleMode aScaleMode | The scaling mode of this image visual. |
IMPORT_C void | SetSecondaryAlpha | ( | const TAlfTimedValue & | aAlpha | ) |
Sets alpha for the secondary image. If one, the primary image is not visible at all.
const TAlfTimedValue & aAlpha | Alpha value for the image |
IMPORT_C void | SetSecondaryImage | ( | const TAlfImage & | aImage | ) |
Sets the secondary image displayed by the image visual.
The reason there are two images is to make crossfading simpler from the application's point of view. The blending ratio between the images is controlled with the timed value iSecondaryAlpha of CAlfImageVisual .
If iSecondaryAlpha is zero (the default), the secondary image will not be drawn. When iSecondaryAlpha increases, the secondary image becomes gradually visible as its opacity increases.
When crossfading is not needed, SetSecondaryImage() and iSecondaryAlpha can be ignored.
const TAlfImage & aImage |
IMPORT_C void | SetStretch | ( | TInt | aTop, |
TInt | aBottom | |||
) |
Sets the stretch widths of the image. Set both to zero to disable stretching. A stretched image will be scaled over the whole width or height of the visual, except for a band specified by the parameters, which will not be scaled (1:1 pixel mapping). For doing uniform scaling of an image, use the SetScaleMode API instead.
Deprecated as an unneeded and broken functionality.
SetStretchMode . CHuiGc::DrawStretchImage
IMPORT_C void | SetStretchMode | ( | CAlfGc::TStretchMode | aStretchMode | ) |
Sets the stretch mode of the image.
CHuiGc::DrawStretchImage . Setstretch.
CAlfGc::TStretchMode aStretchMode | Horizontal or vertical. |
IMPORT_C void | SetTurnAngle | ( | const TAlfTimedValue & | aAngle | ) |
Sets angle for turning the image around its center point.
const TAlfTimedValue & aAngle |
IMPORT_C TAlfTimedValue | TurnAngle | ( | ) |
Gets angle for turning the image around its center point.
IMPORT_C void | UpdateChildrenLayout | ( | TInt | aTransitionTime = 0 | ) | [virtual] |
Update the layout of all children. Subclasses can call this to recalculate the layout of all children.
TInt aTransitionTime = 0 | Time for layout transition in milliseconds. Any negative value uses value given in CAlfEnv::StaticSetLayoutTransitionTime() |
Color modes.
EColorModulate |
Default color mode. |
EColorDimmed |
A dimmed color mode will apply fogging to this visual. |
Image scaling modes.
EScaleNormal |
Image is not scaled. It will be drawn at a 1:1 mapping between its texture and the screen pixels. |
EScaleFitWidth |
Image is uniformly scaled to fit the width of the visual's area. The aspect ratio of the image is preserved. |
EScaleFitHeight |
Image is uniformly scaled to fit the height of the visual's area. The aspect ratio of the image is preserved. |
EScaleCover |
Image is uniformly scaled to fit the visual's area so that the entire area is covered. The aspect ratio of the image is preserved. |
EScaleFit |
Image is uniformly scaled to fit the visual's area. The aspect ratio of the image is not preserved. This is the default scale mode. It allows full control of the appearance of the image by adjusting the visual's size. |
EScaleFitInside |
Image is uniformly scaled to fit inside the visual's area. The aspect ratio of the image is preserved. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.