Class Index | File Index

Classes


Class cc.Image


Extends cc.Class.

Defined in: CCImage.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Image
Method Summary
Method Attributes Method Name and Description
 
 
 
 
 
 
 
initWithImageData(pData, nDataLen, eFmt, width, height, nBitsPerComponent)
Load image from stream buffer.
 
initWithImageFile(strPath, eImgFmt)
Load the image from the specified path.
 
initWithImageFileThreadSafe(fullpath, imageType)
The same meaning as initWithImageFile, but it is thread safe.
 
initWithString(text, width, height, eAlignMask, pFontName, nSize)
Create image with specified string.
 
 
saveToFile(filePath, isToRGB)
Save the CCImage data to specified file with specified format.
Class Detail
cc.Image()
Image
Method Detail
getBitsPerComponent()

getData()

getDataLen()

getHeight()

getWidth()

hasAlpha()

{Boolean} initWithImageData(pData, nDataLen, eFmt, width, height, nBitsPerComponent)
Load image from stream buffer.
Parameters:
{Array} pData
stream buffer that hold the image data
{Number} nDataLen
the length of data(managed in byte)
{Number} eFmt
{Number} width
{Number} height
{Number} nBitsPerComponent
Returns:
{Boolean} true if load correctly

{Boolean} initWithImageFile(strPath, eImgFmt)
Load the image from the specified path.
Parameters:
{String} strPath
the absolute file path
{Number} eImgFmt
the type of image, now only support tow types.
Returns:
{Boolean} true if load correctly

{Boolean} initWithImageFileThreadSafe(fullpath, imageType)
The same meaning as initWithImageFile, but it is thread safe. It is casued by loadImage() in cc.TextureCache.
Parameters:
{String} fullpath
full path of the file
{Number} imageType
the type of image, now only support tow types.
Returns:
{Boolean} true if load correctly

initWithString(text, width, height, eAlignMask, pFontName, nSize)
Create image with specified string.
Parameters:
{cc.Texture2D} text
the text which the image show, nil cause init fail
{Number} width
the image width, if 0, the width match the text's width
{Number} height
the image height, if 0, the height match the text's height
{Number} eAlignMask
the test Alignment
{String} pFontName
the name of the font which use to draw the text. If nil, use the default system font.
{Number} nSize
the font size, if 0, use the system default size.

isPremultipliedAlpha()

{Boolean} saveToFile(filePath, isToRGB)
Save the CCImage data to specified file with specified format.
Parameters:
{String} filePath
the file's absolute path, including file subfix
{Boolean} isToRGB
if the image is saved as RGB format
Returns:
{Boolean}

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 09 2013 07:51:51 GMT-0800 (PST)