setImage:function(imageVal){//从摄像机的视频流中获取正在运行的图像
var oVBox = this.getView()。byId(" wow");
var Items = oVBox.getItems();
var snapId ='rk-'+ Items.length;
var textId = snapId +'-text';
var oCanvas = new sap.ui.core.HTML({
内容:" " +" "}});
oVBox.addItem(oCanvas);
oCanvas.addEventDelegate({
onAfterRendering:function(){
var snapShotCanvas = document.getElementById(snapId);
var oContext = snapShotCanvas.getContext('2d');
var image = new sap.m.Image({});
image.setSrc(" data:image/jpeg; base64," + imageVal);
oContext.drawImage(image,0,0,snapShotCanvas.width,snapShotCanvas.height);}});}
嗨Ram,
尝试执行以下操作:
setImage():
我在控制台中捕获按钮的clikc出现错误,但没有 图片预览。
未捕获的TypeError:无法在'CanvasRenderingContext2D'上执行'drawImage':提供的值不是'(CSSImageValue或HTMLImageElement或SVGImageElement或HTMLVideoElement或HTMLCanvasElement或ImageBitmap或OffscreenCanvas)类型的值
BR,
RK
嗨拉姆,
尝试一下:
一周热门 更多>