本文整理汇总了Java中javax.microedition.lcdui.Image.createRGBImage方法的典型用法代码示例。如果您正苦于以下问题:Java Image.createRGBImage方法的具体用法?Java Image.createRGBImage怎么用?Java Image.createRGBImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.microedition.lcdui.Image
的用法示例。
在下文中一共展示了Image.createRGBImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SaveImage
import javax.microedition.lcdui.Image; //导入方法依赖的package包/类
/**
* Retorna uma Image gerada a partir do CTonsCinza
*/
Image SaveImage() {
int[] rawRGB = new int[Larg*Alt];
int ponteiro = 0;
for (int y = 0; y < Alt; y++) {
for (int x = 0; x < Larg; x++) {
rawRGB[ponteiro] = TonsCinza[y][x];
rawRGB[ponteiro] = TonsCinza[y][x];
rawRGB[ponteiro++] = TonsCinza[y][x];
}
}
Image img = Image.createRGBImage(rawRGB, Larg, Alt, false);
return img;
}
示例2: convert
import javax.microedition.lcdui.Image; //导入方法依赖的package包/类
/**
* Utility to convert a RIM API Bitmap into a J2ME LCDUI Image. This assists
* in using this library within a MIDP application, where the
* drawTexturedPath method is not available.
*
* @param bitmap
* the source Bitmap
* @return the Image object based on the Bitmap data
* @since 1.2
*/
public static Image convert(Bitmap bitmap) {
int[] data = new int[bitmap.getWidth() * bitmap.getHeight()];
bitmap.getARGB(data, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
return Image.createRGBImage(data, bitmap.getWidth(), bitmap.getHeight(), true);
}