public class

ImageBitmap

extends Image
java.lang.Object
   ↳ net.pierrox.lightning_launcher.script.api.Image
     ↳ net.pierrox.lightning_launcher.script.api.ImageBitmap

Class Overview

Wraps a static bitmap. Such an image can be loaded from file, created using createImage(int, int), or obtained from items icons.

Summary

Public Methods
Canvas draw()
Draw free content on this icon.
Bitmap getBitmap()
Retrieves the Android Bitmap associated with this image.
int getHeight()
Return the image height
int getWidth()
Return the image width
void save()
Save the modified image (with #draw) to file, and update the associated item if any.
boolean saveToFile(String path, Bitmap.CompressFormat format, int quality)
Save the underlying bitmap to file
void update()
Update the item using this image.
[Expand]
Inherited Methods
From class net.pierrox.lightning_launcher.script.api.Image
From class java.lang.Object

Public Methods

public Canvas draw ()

Draw free content on this icon. The image must be a bitmap, it cannot work with nine patch. In addition to the Canvas class, the following Android classes are currently available

  • Color
  • LinearGradient
  • Matrix
  • Paint
  • Path
  • PorterDuff
  • RadialGradient
  • RectF
  • Region
  • Shader
  • SweepGradient
  • Typeface

Returns
  • a canvas used to draw on this icon

public Bitmap getBitmap ()

Retrieves the Android Bitmap associated with this image.

public int getHeight ()

Return the image height

public int getWidth ()

Return the image width

public void save ()

Save the modified image (with #draw) to file, and update the associated item if any. Such an image is typically retrieved through

public boolean saveToFile (String path, Bitmap.CompressFormat format, int quality)

Save the underlying bitmap to file

Parameters
path where to store the file
quality only useful for JPEG (0-100)
Returns
  • true if the operation succeeded

public void update ()

Update the item using this image. This method only applies to images loaded in RAM, not file backed images. This method need to be called in order to refresh the object on the screen after the image has been modified through #draw.