DrawImage
from
byte[]
array using GameCanvas, is it possible?
Server sends jpg-image, which stores in
byte[]
array
, how to display it?
I have seen about drawing from
int[]
array
, where each element is RGB color,
by in my case I need to decode image fist.
Please, help.
edit:
try{
os.write(data);
Thread.sleep(200);
while(is.available()==0)
{
}
slen = 96860;
byte[] img = new byte[96860];
is.read(img, 0, slen);
Image image = Image.createImage(img,0,slen);
g.drawImage(image,
0,
0,
100);
}
catch(Exception x){
System.out.print(x.toString());
}
in Debug i see image size and content, and this method works when use ImageItem and form.append.. , but in Canvas - it not works.