本文整理汇总了Java中net.rim.device.api.system.Bitmap.setARGB方法的典型用法代码示例。如果您正苦于以下问题:Java Bitmap.setARGB方法的具体用法?Java Bitmap.setARGB怎么用?Java Bitmap.setARGB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.rim.device.api.system.Bitmap
的用法示例。
在下文中一共展示了Bitmap.setARGB方法的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: createImage
import net.rim.device.api.system.Bitmap; //导入方法依赖的package包/类
public Object createImage(int[] rgb, int width, int height) {
Bitmap image = new Bitmap(width, height);
image.setARGB(rgb, 0, width, 0, 0, width, height);
return image;
}
示例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: onInitialize
import net.rim.device.api.system.Bitmap; //导入方法依赖的package包/类
protected void onInitialize() {
int width = Display.getWidth();
int height = Display.getHeight();
Bitmap bitmap = new Bitmap( width, height );
bitmap.setARGB( getRGB(), 0, width, 0, 0, width, height );
setBitmapField( new BitmapField( bitmap ) );
}