Android HC: maGetImageData problem

4 posts / 0 new
Last post
Diego Velazquez
diegolv's picture
Offline
Mobile Wizard
Joined: 4 Oct 2010
Posts:
Android HC: maGetImageData problem

Hi,

RES_IMG_RGB is a 3 pixel png embedded image w/ a red, a green and a blue pixel created w/ MS Paint.

The code:

char s[100];
int *i = new int[100]; 
MARect r = {0, 0, 3, 1}; 
maGetImageData(RES_IMG_RGB, i, &r, 3); 
sprintf(s, "%x %x %x", i[0], i[1], i[2]);

Returns:

FFFF0000 FF00FF00 FF0000FF on Android 2.x/MoRE
0000FFFF 00FF00FF FF0000FF on Android 3.x

Regards,

Diego

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Online
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Interesting... I'll try to look at that a bit in the morning.

Ovidiu
ovidiu's picture
Offline
Mobile Wizard
Joined: 27 Jan 2011
Posts:

It might have to do with the endianess. Have a look: http://stackoverflow.com/questions/6212951/endianness-of-android-ndk

Diego Velazquez
diegolv's picture
Offline
Mobile Wizard
Joined: 4 Oct 2010
Posts:

Hi,

Android 2.x: 0xFF070809 0xFF070809 0xFF070809
800 MHz Cortex-A8

Android 3.x: 0x080800FF 0x080808FF 0x080808FF
CPU Dual-core 1 GHz Cortex-A9

Diego