- // Now convert it to a ByteBuffer in the form expected by the C caller.
-
- byte[] nameb = name.getBytes("UTF-8");
- int size = bitmap.getByteCount() + 4 + nameb.length + 1;
-
- ByteBuffer bits = ByteBuffer.allocateDirect (size);
-
- bits.put ((byte) ((width >> 8) & 0xFF));
- bits.put ((byte) ( width & 0xFF));
- bits.put ((byte) ((height >> 8) & 0xFF));
- bits.put ((byte) ( height & 0xFF));
- bits.put (nameb);
- bits.put ((byte) 0);
+ bitmap = Bitmap.createBitmap (bitmap, 0, 0,
+ bitmap.getWidth(), bitmap.getHeight(),
+ matrix, true);