public interface ImageUtils
| Modifier and Type | Method and Description |
|---|---|
void |
convertToPng(File srcFile,
File dstFile)
Convert image to png
|
void |
copyAndroidDrawablesFromTmpToWork(File tmpDirectory,
File workDirectory)
Copy Android drawable resources from tmp directory to work directory
(drawable-ldpi to drawable-xxhdpi)
|
BufferedImage |
cropImage(BufferedImage originalImage,
int width,
int height)
Crop image to desired size
|
String |
normalizeImageName(String value)
Normalize image name replacing non-alphanumeric characters by "_"
|
BufferedImage |
resizeImage(BufferedImage originalImage,
int maxWidth,
int maxHeight)
Resize image to desired size
|
BufferedImage |
resizeImage(File originalImageFile,
int maxWidth,
int maxHeight)
Resize image to desired size
|
void |
resizeImageForAllAndroidDensities(String imageName,
File imageFile,
File tmpDirectory)
Resize image for all densities (ldpi/mdpi/hdpi/xhdpi/xxdpi)
|
BufferedImage |
resizeImageSquare(BufferedImage originalImage,
int size)
Resize image to desired square size
|
BufferedImage |
resizeImageSquare(File originalImageFile,
int size)
Resize image to desired size
|
void |
resizeImageToIcon(InputStream stream,
File destFile)
Resize image to fit icon specs
|
void |
saveAndroidIcons(File icon,
File directory,
String iconName)
Export to android icons (ldpi/mdpi/hdpi/xhdpi/xxhdpi/xxxhdpi)
|
void |
saveIosIcons(File icon,
File directory,
String iconName)
Export to ios icons (icon,icon@2x,40,40@2x,50,50@2x,60,60@2x,72,72@2x,76,76@2x,small,small@2x)
|
void |
saveIosSplashScreens(File ss,
File directory)
Export to ios splashscreens
|
void |
writeBufferedImageToFile(BufferedImage image,
File file)
Write buffered image to file
|
void resizeImageToIcon(InputStream stream, File destFile)
stream - the input stream of the imagedestFile - the destination filevoid saveAndroidIcons(File icon, File directory, String iconName)
icon - the icon filedirectory - the destination directoryiconName - the icon namevoid saveIosIcons(File icon, File directory, String iconName)
icon - the icon filedirectory - the destination directoryiconName - the icon namevoid saveIosSplashScreens(File ss, File directory)
ss - the splashscreen image filedirectory - the destination directoryString normalizeImageName(String value)
value - image input namevoid copyAndroidDrawablesFromTmpToWork(File tmpDirectory, File workDirectory)
tmpDirectory - tmp input directoryworkDirectory - work output directoryvoid resizeImageForAllAndroidDensities(String imageName, File imageFile, File tmpDirectory)
imageName - image nameimageFile - image filetmpDirectory - tmp input directoryBufferedImage resizeImage(BufferedImage originalImage, int maxWidth, int maxHeight)
originalImage - the BufferedImagemaxWidth - the maximum width in pxmaxHeight - the maximum height in pxBufferedImage resizeImage(File originalImageFile, int maxWidth, int maxHeight)
originalImageFile - the FilemaxWidth - the maximum width in pxmaxHeight - the maximum height in pxBufferedImage cropImage(BufferedImage originalImage, int width, int height)
originalImage - the BufferedImagewidth - the width in pxheight - the height in pxBufferedImage resizeImageSquare(BufferedImage originalImage, int size)
originalImage - the BufferedImagesize - the target size in pxBufferedImage resizeImageSquare(File originalImageFile, int size)
originalImageFile - the Filesize - the target size in pxvoid convertToPng(File srcFile, File dstFile)
srcFile - the source filedstFile - the destination png filevoid writeBufferedImageToFile(BufferedImage image, File file)
image - the imagefile - the fileCopyright © 2015. All rights reserved.