public class ImageProcessor extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ImageProcessor.ImageCreateAndLoadHandler |
static interface |
ImageProcessor.ImageLoadHandler |
| Modifier | Constructor and Description |
|---|---|
protected |
ImageProcessor()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Blob |
asGif()
Export content image as a GIF file.
|
Blob |
asJpeg(double quality)
Export content image as a JPEG file.
|
Blob |
asPng()
Export content image as a PNG file.
|
static ImageProcessor |
createIfSupported()
If the current browser supports, create a new ImageProcessor
|
static void |
createIfSupportedAndLoadImage(Blob image,
ImageProcessor.ImageCreateAndLoadHandler handler)
Create ImageProcessor instance and automatically loads the image.
|
static void |
createIfSupportedAndLoadImage(String url,
ImageProcessor.ImageCreateAndLoadHandler handler)
Create ImageProcessor instance and automatically loads the image.
|
void |
ensureMaxSize(int maxHeight,
int maxWidth,
boolean keepProportions)
Ensure a max size for the image
|
static boolean |
isSupported()
Check if browser supports this feature
|
void |
loadImage(Blob image,
ImageProcessor.ImageLoadHandler handler)
Loads an image to the processor.
|
void |
loadImage(String url,
ImageProcessor.ImageLoadHandler handler)
Loads an image to the processor.
|
void |
resize(int width,
int height)
Resize the internal image
|
public static void createIfSupportedAndLoadImage(Blob image, ImageProcessor.ImageCreateAndLoadHandler handler)
file - Image Filehandler - Called whem image is completely loadedpublic static void createIfSupportedAndLoadImage(String url, ImageProcessor.ImageCreateAndLoadHandler handler)
url - Image URLhandler - Called whem image is completely loadedpublic void loadImage(String url, ImageProcessor.ImageLoadHandler handler)
url - Image URLhandler - Called whem image is completely loadedpublic void loadImage(Blob image, ImageProcessor.ImageLoadHandler handler)
file - Image Filehandler - Called whem image is completely loadedpublic void ensureMaxSize(int maxHeight,
int maxWidth,
boolean keepProportions)
maxHeight - maxWidth - keepProportions - public void resize(int width,
int height)
width - height - public Blob asJpeg(double quality)
quality - JPEG quality. It ranges from 0.0 to 1.0public Blob asPng()
public Blob asGif()
public static boolean isSupported()
public static ImageProcessor createIfSupported()
Copyright © 2015. All rights reserved.