我实现了这个https://fancyproductdesigner.com/jquery/,效果很好。我的查询是当我在演示站点上上传的图像固定在产品形状上时。例如,当我在帽上上传徽标时,徽标可以灵活地固定在帽的形状上。但是在我的集成中,这是行不通的。
我的代码是:
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private void initRecorder() {
try {
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
videoUri = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
+ new StringBuilder("/Rec_").append(new SimpleDateFormat("dd-MM-yyyy-hh-mm-ss").format(new Date()))
.append(".mp4").toString();
mediaRecorder.setOutputFile(videoUri);
mediaRecorder.setVideoSize(DISPLAY_WIDTH, DISPLAY_HEIGHT);
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mediaRecorder.setVideoEncodingBitRate(500 * 1000);
mediaRecorder.setVideoFrameRate(30);
int rotation = getWindowManager().getDefaultDisplay().getRotation();
int orientation = ORIENTATIONS.get(rotation + 90);
mediaRecorder.setOrientationHint(orientation);
mediaRecorder.prepare();
} catch (Exception e) {
}
}