本文整理汇总了Java中net.rim.device.api.system.Bitmap.getARGB方法的典型用法代码示例。如果您正苦于以下问题:Java Bitmap.getARGB方法的具体用法?Java Bitmap.getARGB怎么用?Java Bitmap.getARGB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.rim.device.api.system.Bitmap
的用法示例。
在下文中一共展示了Bitmap.getARGB方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawPixels
import net.rim.device.api.system.Bitmap; //导入方法依赖的package包/类
private static void drawPixels(Bitmap src, int[][] m, int destX, int destY) {
int[] data = new int[m.length * m.length];
src.getARGB(data, 0, m.length, destX, destY, m.length, m.length);
for (int y = destY; y < destY + m.length; ++y) {
for (int x = destX; x < destX + m[y - destY].length; ++x) {
int pos = m.length * (y - destY) + x - destX;
int b = data[pos] % RoundAngles.E1;
int g = (data[pos] - b) / 256 % RoundAngles.E1;
int r = (data[pos] - b - RoundAngles.E1 * g) / RoundAngles.E2 % RoundAngles.E1;
data[pos] = m[y - destY][x - destX] * RoundAngles.E3 + b + g * RoundAngles.E1 + r
* RoundAngles.E2;
}
}
src.setARGB(data, 0, m.length, destX, destY, m.length, m.length);
}
示例2: copyBitmapSection
import net.rim.device.api.system.Bitmap; //导入方法依赖的package包/类
/**
* Creates a bitmap that is a copy of a portion of an existing bitmap.
*
* @param src the source bitmap
* @param x the x offset
* @param y the y offset
* @param width the width to copy
* @param height the height to copy
* @return a new Bitmap that is a copy of the specified portion of the specified bitmap
*/
private Bitmap copyBitmapSection(Bitmap src, int x, int y, int width, int height) {
if (x < 0 || y < 0 || x + width > src.getWidth() || y + height > src.getHeight()) {
throw new IllegalArgumentException(
"must not specify a rectangle that falls outside of the source bitmap");
}
Bitmap dst = new Bitmap(width, height);
int[] raw = new int[width * height];
src.getARGB(raw, 0, width, x, y, width, height);
dst.setARGB(raw, 0, width, 0, 0, width, height);
return dst;
}
示例3: getRGB
import net.rim.device.api.system.Bitmap; //导入方法依赖的package包/类
public void getRGB(Object nativeImage, int[] arr, int offset, int x, int y, int width, int height) {
Bitmap b = (Bitmap) nativeImage;
b.getARGB(arr, offset, width, x, y, width, height);
}
示例4: copyBitmapSectionToBitmap
import net.rim.device.api.system.Bitmap; //导入方法依赖的package包/类
/**
* Copies a portion of a bitmap into a second bitmap.
*
* @param dst the destination bitmap
* @param dstXOffset the destination x offset
* @param dstYOffset the destination y offset
* @param width the width to copy
* @param height the height to copy
* @param src the source bitmap
* @param srcXOffset the source x offset
* @param srcYOffset the source y offset
*/
private void copyBitmapSectionToBitmap(Bitmap dst, int dstXOffset, int dstYOffset, int width,
int height, Bitmap src, int srcXOffset, int srcYOffset) {
int[] raw = new int[width * height];
src.getARGB(raw, 0, width, srcXOffset, srcYOffset, width, height);
dst.setARGB(raw, 0, width, dstXOffset, dstYOffset, width, height);
}
示例5: convert
import net.rim.device.api.system.Bitmap; //导入方法依赖的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);
}