09-14-2010 01:39 AM
I am retrieving bitmap in form of int[ ] containing RGB values of pixels from server. Is there a way to convert this form into bitmap directly w/o converting individual pixel value into byte? I need to do this very frequently.
Thanks in advance.
09-14-2010 02:11 AM
Follow these steps:
An alternative is to go through your RGB array and set the high-order (alpha) byte to 0xFF (data[i] |= 0xFF000000) and then just call setARGB for the bitmap directly after step 1.
09-14-2010 02:30 AM
I am already using the first one
I think second one would be nice if updates are not so frequent.
09-14-2010 04:39 AM - edited 09-14-2010 04:40 AM
" am retrieving bitmap in form of int[ ] containing RGB values of pixels from server."
I doubt the network connection will supply data fast enough to flood this conversion process. However why don't you get the Server to send pngs rather than these ints that need conversion?
09-14-2010 05:26 AM
Server is sending bitmaps fast enough. You can think of it as an animation frame by frame.
I don't have control on the server they have their own protocol.