이미지?를 저장하는 방법? Pls는 나를 도와 .... 어떤 인코더가 전화 memory.Is에 J2ME 응용 프로그램 에서 이미지를 저장 또는 바이트 배열로 변환 할에서 j2me s40의 전화 메모리에 이미지를 저장하는 방법? 로컬로 application.I에 저장됩니다
try {
String url=System.getProperty("fileconn.dir.photos")+"model0_0.jpg";
FileConnection fc=(FileConnection)Connector.open(url,Connector.READ_WRITE);
if(!fc.exists()) {
fc.create();
}else {
// return;
}
OutputStream os=fc.openOutputStream();
int iw=galleryImage.getWidth();int ih=galleryImage.getHeight();
rawInt=new int[iw*ih];
galleryImage.getRGB(rawInt,0,iw,0,0,iw,ih);
ByteArrayOutputStream baos=new ByteArrayOutputStream();
for(int i=0;i<rawInt.length;i++)
baos.write(rawInt[i]);
byte byteData[]=baos.toByteArray();
baos.close();
ByteArrayInputStream b_stream=new ByteArrayInputStream(byteData);
int i=0;
/*while((i=b_stream.read())!=-1) {
os.write(i);
}*/
for(i=0;i<content.length;i++) {
os.write(b_stream.read());
}
//os.write(byteData);
os.flush();
os.close();
System.out.println("\n\nImage Copied..\n");
fc.close();
} catch (IOException e) {
//System.out.println("image not read for gallery");
e.printStackTrace();
}
catch(java.lang.IllegalArgumentException iae){iae.printStackTrace();}
catch(Exception e){e.printStackTrace();}
나는이 코드를 시도했다. 하나의 포맷되지 않은 파일이 불량 이미지 폴더에 저장되면 그 파일 크기는 0.0KB이다. 생각해 보면, 이미지를 읽을 수 없다 ............
E에서 이미지 저장을 시도하십시오., E :는 Nokia Device에있는 휴대 전화의 SD 카드입니다. – Lucifer
고마워, 알았다. pls는 링크 https://github.com/Pash237/j2me-JPEG-library를 통해 가서 com 폴더 파일을 다운로드하고 내 응용 프로그램을 가져 와서 몇 줄을 바꿉니다. 잘 작동합니다 ....... – ranjith