org.appcelerator.titanium.view
Class TiDrawableReference

java.lang.Object
  extended by org.appcelerator.titanium.view.TiDrawableReference

public class TiDrawableReference
extends Object

Helper class for loading, scaling, and caching images if necessary.


Method Summary
static TiDrawableReference fromBlob(Activity activity, TiBlob blob)
          Creates and returns a TiDrawableReference with type DrawableReferenceType.BLOB.
static TiDrawableReference fromObject(Activity activity, Object object)
          Does its best to determine the type of reference (url, blob, etc) based on object parameter.
static TiDrawableReference fromUrl(Activity activity, String url)
          Creates and returns a TiDrawableReference with type DrawableReferenceType.URL.
static TiDrawableReference fromUrl(KrollProxy proxy, String url)
          Resolves the url, then creates and returns a TiDrawableReference instance.
 Bitmap getBitmap()
          Gets the bitmap from the resource without respect to sampling/scaling.
 

Method Detail

fromBlob

public static TiDrawableReference fromBlob(Activity activity,
                                           TiBlob blob)
Creates and returns a TiDrawableReference with type DrawableReferenceType.BLOB.

Parameters:
activity - the referenced activity.
blob - the referenced blob.
Returns:
A ready instance of TiDrawableReference.

fromUrl

public static TiDrawableReference fromUrl(KrollProxy proxy,
                                          String url)
Resolves the url, then creates and returns a TiDrawableReference instance.

Parameters:
proxy - the activity proxy.
url - the url to resolve.
Returns:
A ready instance of TiDrawableReference.

fromUrl

public static TiDrawableReference fromUrl(Activity activity,
                                          String url)
Creates and returns a TiDrawableReference with type DrawableReferenceType.URL.

Parameters:
activity - the referenced activity.
url - the resource's url.
Returns:
A ready instance of TiDrawableReference.

fromObject

public static TiDrawableReference fromObject(Activity activity,
                                             Object object)
Does its best to determine the type of reference (url, blob, etc) based on object parameter.

Parameters:
activity - the referenced activity.
object - the referenced object.
Returns:
A ready instance of TiDrawableReference.

getBitmap

public Bitmap getBitmap()
Gets the bitmap from the resource without respect to sampling/scaling.

Returns:
Bitmap, or null if errors occurred while trying to load or fetch it.


Copyright © 2010-2012 Appcelerator, Inc. Licensed under the Apache License 2.0