[JNA] Convertir tableau de int en Pointer
Bonjour,
Tout est dans le titre.
J'ai un tableau de int et je voudrais obtenir le pointer associé pour le passer à la fonction "GetDIBits" qui attend un pointer vers un tableau de pixel.
J'ai beau lire la doc sun jna 10 fois je n'arrive pas à faire la conversion.
Help plz :'(.
Pour l'instant j'ai ça qui me produit une belle stacktrace :
Code:
1 2 3 4 5 6 7 8 9 10
|
int[] colorBits = new int[width * height];
Pointer pointerColorBits = new Pointer(0);
pointerColorBits.write(0, colorBits, 0, colorBits.length);
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fefe431214, pid=4152, tid=5040 |