Ti.ImageFactory Module

Description

This module provides a set of image transformation functions.

Accessing the Ti.ImageFactory Module

To access this module from JavaScript, you would do the following:

var ImageFactory = require('ti.imagefactory');

Functions

imageWithAlpha

Creates a new image by creating a copy of the given image, adding an alpha channel if it doesn't already have one.

Arguments

imageWithTransparentBorder

Creates a new image by creating a copy of the given image, adding a transparent border of the given size around its edges. The size of the image will be expanded by the specified border size.

Arguments

imageWithRoundedCorner

Creates a new image by creating a copy of the given image with rounded corners.

Arguments

imageAsThumbnail

Creates a new image by creating a copy of the given image that is squared to the thumbnail size.

Arguments

imageAsResized

Creates a new image by creating a copy of the given image that is rescaled to the specified size.

Arguments

imageAsCropped

Creates a new image by creating a copy of the given image that is cropped to the specified bounds.

Arguments

imageTransform

Creates a new image by applying a sequence of transformations to the image.

Arguments

compress

Creates a new image by creating a copy of the given image and applying the specified compression quality.

Arguments

compressToFile(image, compression, fileURL)

Compresses the provided image straight out to a file. This method is quite a bit lighter on memory usage than the others.

Arguments

Usage

See example.

Author

Jeff English

Module History

View the change log for this module.

Feedback and Support

Please direct all questions, feedback, and concerns to info@appcelerator.com.

License

Copyright(c) 2010-2011 by Appcelerator, Inc. All Rights Reserved. Please see the LICENSE file included in the distribution for further details.