LWUIT 양식의 배경 이미지로 png
이미지를 만들고 싶습니다. 문제는 이미지가 변경되었음을 의미합니다. 이미지의 모양이 배경의 이미지로 설정된 후에 이미지에 얼룩이 있습니다. 다음 코드는 다음과 같습니다PNG LWUIT 양식의 배경 이미지로 설정하면 이미지가 심하게 오염됩니다.
public class DetailPhotoClient extends Form implements ActionListener {
private Command options, delete, back, annuler, ok;
private GaleriePhotos backForm;
private FileConnection fcFile;
private Image sourceImage, fullImage;
private InputStream is;
private PopupMenu popup;
public DetailPhotoClient(GaleriePhotos prevForm, String absolutePathphotoName)
{
super();
back = new Command("Retour");
options = new Command("Options");
this.addCommand(back);
this.addCommand(options);
this.addCommandListener(this);
delete = new Command("Supprimer");
annuler = new Command("Annuler");
ok = new Command("Ok");
backForm = prevForm;
try {
fcFile = (FileConnection) Connector.open(absolutePathphotoName, Connector.READ);
is = fcFile.openInputStream();
sourceImage = Image.createImage(is);
fullImage = createThumbnail(sourceImage);
setBgImage(fullImage);
is.close();
fcFile.close();
} catch (IOException ex) {
handleException();
} catch (OutOfMemoryError oom) {
handleOOM();
}
}
private Image createThumbnail(Image image) {
Image thumb = image.scaled(this.getPreferredW(), this.getPreferredH());
return thumb;
}
...
}
은 내가 수동으로 사진을 열 때, 즉 전화 메모리의 사진 폴더에서 것을 발견, 다음 사진은 변경되지 않습니다!
양식의 배경 이미지로 설정할 때 이미지를 변경하지 않으려면 어떻게해야합니까?
(this.getWidth()를, this.getHeight()); ' – pheromix