Skip to content
9miao edited this page Sep 29, 2014 · 3 revisions

CAImageView

Class Description

Image control that display image on screen.

Base Class

CAView

Attribute

Access modifier

Attribute name

Description

public

Image

image that imageView displays

public

ImageViewScaleType

imageView’s scale mode

Method

Access modifier

Method name

Description

public

createWithImage

create imageView by using CAImage to load texture

public

setImageAsyncWithFile

load texture by adopting asynchronous mode

 

Attribute Description

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;

Method Description

static CAImageView createWithImage(CAImage image)**
Return value: static CAImageView*
Parameter name

Type

Parameter name

Description

CAImage*

image

texture object that we use

Descripiton: create an imageView and transfer a CAImage object as display content.

virtual void setImageAsyncWithFile(const char fileName)*
Return value: void
Parameter:

Type

Parameter name

Description

const char*

fileName

image name

Descripiton: load designated texture by adopting asynchronous mode
Clone this wiki locally