Dans mon application, je crée une image bitmap à partir de son code de couleurs comme ceci:CreateBitmap provoque une erreur OutOfMemory
int width=getImageWidth();
int height=getImageHeight();
int[] array=getbitmap();
int[] colorsAsIntegers = new int[width*height];
int i = 0;
int j = 0;
while (i<width*height*4) {
colorsAsIntegers[j] = Color.argb(array[i], array[i+1], array[i+2],
array[i+3]);
i += 4;
j++;
}
myBitmap=Bitmap.createBitmap(colorsAsIntegers,
width,
height,
Bitmap.Config.ARGB_8888);
Et souvent, je reçois le OutOfMemoryError :( Alors, comment puis-je utiliser l'optimisation BitmapFactory pour éviter ce problème? parce que je n'ai pas un flux d'entrée ou d'un fichier, je ne contenant un tableau mes pixels
Merci
Quelle est la taille de votre image? Quel appareil rencontrez-vous des problèmes? – I82Much
Il ne crée pas bitmap tout le temps nous obtenons cette erreur. http://stackoverflow.com/a/18625792/2403532 – Narasimha