java.lang.Object | |
↳ | net.pierrox.lightning_launcher.script.api.Image |
Known Direct Subclasses |
Utility class to manipulate images (icons, backgrounds, etc.). This is the base class for various kind of images. Each image type (bitmap, nine patch, animation, scripted) have their own set of features. Please refer to their respective documentation.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static ImageAnimation |
createAnimation(int width, int height, int count, int duration, int loopCount)
Create a blank animation: frames are created fully transparent and need to be drawn.
| ||||||||||
static Image |
createImage(String path)
Create an image from the specified file.
| ||||||||||
static ImageBitmap |
createImage(int width, int height)
Create a blank new image of the specified size.
| ||||||||||
static Image |
createImage(String pkg, String name)
Create an image from a package and a resource name.
| ||||||||||
static ImageScript |
createImage(Scriptable object, int width, int height)
Create an image whose content is drawn using a script.
| ||||||||||
static ImageBitmap |
createTextIcon(String code, int size, int fgColor, int bgColor, Typeface typeface)
Create an icon using text.
| ||||||||||
void |
delete()
Delete this image from persistent storage (if loaded from a file).
| ||||||||||
abstract int |
getHeight()
Return the image height
| ||||||||||
String |
getType()
Return the type of this image.
| ||||||||||
abstract int |
getWidth()
Return the image width
| ||||||||||
boolean |
isNinePatch()
This method is deprecated.
use #getType instead
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a blank animation: frames are created fully transparent and need to be drawn. Notes: animations created this way are memory expensive and cannot be persisted (yet). This means that Shortcut.setCustomIcon() wont't work, but Shortcut.setImage() will.
width | image width |
---|---|
height | image height |
count | number of frames to allocate |
duration | default frame duration |
loopCount | initial number of loops to play, use 0 for infinite |
Create an image from the specified file.
path | path of the image |
---|
Create a blank new image of the specified size. Pixel format is always ARGB 8888. Take care when creating images since it can rapidly exhaust memory and lead to a crash.
Create an image from a package and a resource name.
For instance:LL.createImage("net.pierrox.lightning_launcher_extreme", "icon")
The density used is either the one given by ActivityManager.getLauncherLargeIconDensity if available, or the current one.
pkg | name of the package, use "android" to access system resources. |
---|---|
name | name of the drawable resource |
Create an image whose content is drawn using a script.
This can be used for memory efficient graphics and animations.
Please refer to ImageScript
for the documentation on how to use it.
object | the set of functions |
---|---|
width | the prefered image width, use -1 for as big as possible |
height | the prefered image height, use -1 for as big as possible |
Create an icon using text. This function is intended to be used with an icon font to create high res icons.
code | character to use |
---|---|
size | icons are square : width = height = size |
fgColor | foreground color |
bgColor | background color |
typeface | typeface to use, use the built-in icon typeface if null |
Delete this image from persistent storage (if loaded from a file).
Return the image height
Return the type of this image.
Return the image width
This method is deprecated.
use #getType instead