Appcelerator で写真を保存するのに少し問題があります。
私は写真を撮って保存しています。大丈夫です。コードは次のとおりです。
var cameraOverlay = Ti.UI.createView({
width:'100%',
height:'100%'
});
var porcoOverlay = Ti.UI.createView({
width: '90%',
height: '100%',
left: 0,
top: 0
});
var porco = Ti.UI.createImageView({
width: 200,
height: 238,
top: 10,
left: 10,
image:'images/pig.png',
touchEnabled: false
});
porcoOverlay.add(porco);
cameraOverlay.add(porcoOverlay);
var menuOverlay = Ti.UI.createView({
width: '10%',
height: '100%',
right: 0,
top: 0
});
var takeFoto = Ti.UI.createButton({
title: 'PH',
bottom: 10,
right: 10
});
menuOverlay.add(takeFoto);
cameraOverlay.add(menuOverlay);
Ti.Media.showCamera({
showControls:true,
overlay: cameraOverlay,
saveToPhotoGallery: true,
success:function(event) {
var cropRect = event.cropRect;
var image = event.media;
var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'camera_photo.png');
f.write(image);
}
});
takeFoto.addEventListener('click',function(){
Ti.Media.takePicture();
});
そして、ここに私の問題があります:
1 - オートフォーカスが機能しません。
2 - 画像の解像度は常に 320*240 です。
3 - 写真とオーバーレイを結合して保存したい。
誰でも私を助けることができますか?