Android: How can i convert a Bitmap array to Int array? -


i'm cutting images of int array...

int[] imagenes_originales = new int[] {     r.drawable.image1,     r.drawable.image2,     r.drawable.image3,     r.drawable.image4 }  int[] new_images;  (a = 0; <= 3; a++) {     bitmap bitmap = bitmapfactory.decoderesource(getresources(), imagenes_originales[a]);      int x = bitmap.getwidth(), y = bitmap.getheight();     int escalax = getwindowmanager().getdefaultdisplay().getwidth();      bitmap recorte = bitmap.createbitmap(bitmap, 0, y / 2, escalax, 100); } 

how can convert bitmap images in new_images[] variable?

bitmap bitmap = bitmapfactory.decoderesource(getresources(), imagenes_originales[a]); int x = bitmap.getwidth(); int y = bitmap.getheight(); int[] intarray = new int[x * y]; bitmap.getpixels(intarray, 0, x, 0, 0, x, y); 

your bitmap int array in intarray/


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -