¡@

Home 

2014/10/16 ¤W¤È 08:12:45

android Programming Glossary: dst.position

android how to save a bitmap - buggy code

http://stackoverflow.com/questions/3628016/android-how-to-save-a-bitmap-buggy-code

ByteBuffer dst ByteBuffer.allocate bmSize myVideoScreenshotBm.copyPixelsToBuffer dst byte bytesar new byte bmSize dst.position 0 dst.get bytesar out.write bytesar private void readObject ObjectInputStream in throws IOException ClassNotFoundException.. byte toread new byte bmSize in.read toread 0 toread.length ByteBuffer dst ByteBuffer.allocate bmSize dst.put toread dst.position 0 myVideoScreenshotBm Bitmap.createBitmap width height Bitmap.Config.ALPHA_8 myVideoScreenshotBm.copyPixelsFromBuffer dst.. myVideoScreenshotBm.getHeight if dst null bmSize dst.capacity dst ByteBuffer.allocate bmSize out.writeInt dst.capacity dst.position 0 myVideoScreenshotBm.copyPixelsToBuffer dst if bytesar null bmSize bytesar.length bytesar new byte bmSize dst.position..