-
Notifications
You must be signed in to change notification settings - Fork 421
CAImageView
Image control that display image on screen.
CAView
Access modifier |
Attribute name |
Description |
public |
Image |
image that imageView displays |
public |
ImageViewScaleType |
imageView’s scale mode |
public |
create |
create an imageView object
|
public |
createWithImage |
create imageView by using CAImage to load texture |
public
|
createWithSpriteFrame |
use CAImageFrame image frame to create imageView |
public |
setDisplayFrame |
set current displayed image frame
|
public |
isFrameDisplayed |
judge appointed image frame is displayed or not |
public |
displayFrame |
obtain current displayed image frame
|
public |
setDisplayFrameWithAnimationName |
set a frame in animation frame as current displayed image frame |
public |
setImageAsyncWithFile |
load texture by adopting asynchronous mode
|
Image
Type: CAImage*
Description: imageView’s image attribute, namely the displayed content, public get/set{}.
ImageViewScaleType
Type: CAImageViewScaleType
Description: set imageView’s scale mode, including five types: fitImageXY by default, fully populated; fitImageCrop, fully populated in no-distortion condition and auto-cut excess part; fitImageInside, fully populated, no distortion; fitViewByHorizontal, fully displayed and horizontal adaptive in no-distortion condition; fitViewByVertical, fully displayed and vertical adaptive in no-distortion condition. public get/set{}.
1 2 3 4 5 6 7 8 |
typedef enum { CAImageViewScaleTypeFitImageXY=0, CAImageViewScaleTypeFitImageCrop, CAImageViewScaleTypeFitImageInside, CAImageViewScaleTypeFitViewByHorizontal, CAImageViewScaleTypeFitViewByVertical, }CAImageViewScaleType; |
static CAImageView create()*
Return value: static CAImageView*
Description: create an imageView, there is no display content in imageView at this moment.
static CAImageView createWithImage(CAImage image)**
Return value: static CAImageView*
Parameter name
Type |
Parameter name |
Description |
CAImage* |
image |
texture object that we use |
static CAImageView createWithSpriteFrame(CAImageFrame *pSpriteFrame)*
Return value: static CAImageView*
Parameter:
Type |
Parameter name |
Description |
CAImageFrame* |
pSpriteFrame |
image frame |
virtual void setDisplayFrame(CAImageFrame *pNewFrame)
Return value: void
Parameter:
Type |
Parameter name |
Description |
CAImageFrame* |
pNewFrame |
image frame |
virtual bool isFrameDisplayed(CAImageFrame *pFrame)
Return value: bool
Parameter:
Type |
Parameter name |
Description |
CAImageFrame* |
pSpriteFrame |
image frame |
virtual CAImageFrame displayFrame(void)*
Return value: CAImageFrame*
Description: obtain current displayed image frame
virtual void setDisplayFrameWithAnimationName(const char *animationName, int frameIndex)
Return value: void
Parameter:
Type |
Parameter name |
Description |
const char * |
animationName |
animation sequential frame |
int |
frameIndex |
frame index |
virtual void setImageAsyncWithFile(const char fileName)*
Return value: void
Parameter:
Type |
Parameter name |
Description |
const char* |
fileName |
image name |