net.rim.device.api.ui.image
Class ImageFactory

java.lang.Object
  extended by net.rim.device.api.ui.image.ImageFactory

public class ImageFactory
extends Object

A factory class for creating different types of images. See Image for more details:

Since:
BlackBerry API 5.0.0

Method Summary
static Image createImage(String name)
          Creates an image from provided bitmap name resource.
static Image createImage(String module, String name)
          Creates an image from provided bitmap named resource found in module.
static Image createImage(Bitmap bitmap)
          Create an Image object for the provided Bitmap.
static Image createImage(EncodedImage encodedImage)
          Construct an Image object for the provided EncodedImage.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

createImage

public static Image createImage(Bitmap bitmap)
Create an Image object for the provided Bitmap.

Parameters:
bitmap - Bitmap object to abstract.
Returns:
Image object representing the Bitmap.
Throws:
IllegalArgumentException - if bitmap is null.
Since:
BlackBerry API 5.0.0

createImage

public static Image createImage(EncodedImage encodedImage)
Construct an Image object for the provided EncodedImage.

Parameters:
encodedImage - EncodedImage object to abstract.
Returns:
Image object representing the EncodedImage.
Throws:
IllegalArgumentException - if encodedImage is null.
Since:
BlackBerry API 5.0.0

createImage

public static Image createImage(String module,
                                String name)
Creates an image from provided bitmap named resource found in module.

This method looks for the resource in both the .cod file that called this method and any .cod files that it relies on. The resource files are automatically generated by the compiler when a new graphic (PNG, GIF, or, JPG) is added to a project.

Parameters:
module - Name of the module containing the bitmap resource. If not specified, the name of the calling module is used.
name - Name of the bitmap resource.
Returns:
New Image object, or null if this method couldn't find your named resource.
Throws:
NullPointerException - If the name parameter is null.
IllegalArgumentException - if resource with name parameter can not be found.
Since:
BlackBerry API 6.0.0

createImage

public static Image createImage(String name)
Creates an image from provided bitmap name resource.

This method looks for the resource in both the .cod file that called this method and any .cod files that it relies on. The resource files are automatically generated by the compiler when a new graphic (PNG, GIF, or, JPG) is added to a project.

Parameters:
name - Name of the bitmap resource.
Returns:
New Image object, or null if this method couldn't find your named resource.
Throws:
NullPointerException - If the name parameter is null.
IllegalArgumentException - if resource with name parameter can not be found.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.