当前位置: 首页 > wzjs >正文

建设网站域名备案查询b站24小时自助下单平台网站

建设网站域名备案查询,b站24小时自助下单平台网站,响应式网站设计的要求,宝安的医院网站建设网页截屏 js-web-screen-shot 截取其他窗口 显示不全问题 npm 安装 js-web-screen-shot npm install js-web-screen-shot --savejs-web-screen-shot默认截屏是从左下角开始的,修改成左上角开始,然后编辑cropBoxInfo参数宽高进行截取,目前截…

网页截屏 js-web-screen-shot 截取其他窗口 显示不全问题

npm 安装 js-web-screen-shot

npm install js-web-screen-shot --save

js-web-screen-shot默认截屏是从左下角开始的,修改成左上角开始,然后编辑cropBoxInfo参数宽高进行截取,目前截取适配的其他窗口宽高不能比浏览器页面宽高大

vue代码

import ScreenShot from 'js-web-screen-shot'new ScreenShot({enableWebRtc: true,level: 99999,wrcWindowMode: true,clickCutFullScreen: true,imgAutoFit: true,showScreenData: true,completeCallback: this.callback, // 截图成功完成的回调closeCallback: this.cancelCallback, // 截图取消的回调hiddenScrollBar: {state: true,fillState: true,color: "#FFFFFF"},// cropBoxInfo: {x: 0, y: 0, w: 1757, h: 1011},cropBoxInfo: {x: 0, y: 0, w: 1290, h: 640},// canvasWidth: window.innerWidth,// canvasHeight: window.innerHeight,})

修改js-web-screen-shot代码

main.ts文件

private loadScreenFlowData(triggerCallback: Function | undefined) {setTimeout(() => {// 获取截图区域canvas容器画布if (this.screenShotContainer == null) return;const canvasSize = this.plugInParameters.getCanvasSize();let containerWidth = this.screenShotImageController?.width;let containerHeight = this.screenShotImageController?.height;// 用户有传宽高时,则使用用户的if (canvasSize.canvasWidth !== 0 && canvasSize.canvasHeight !== 0) {containerWidth = canvasSize.canvasWidth;containerHeight = canvasSize.canvasHeight;}let imgContainerWidth = containerWidth;let imgContainerHeight = containerHeight;if (this.wrcWindowMode) {imgContainerWidth = containerWidth * this.dpr;imgContainerHeight = containerHeight * this.dpr;}const context = getCanvas2dCtx(this.screenShotContainer,containerWidth,containerHeight);const imgContext = getCanvas2dCtx(this.screenShotImageController,imgContainerWidth,imgContainerHeight);if (context == null || imgContext == null) return;// 赋值截图区域canvas画布this.screenShotCanvas = context;const { videoWidth, videoHeight } = this.videoController;if (this.wrcWindowMode) {// 从窗口视频流中获取body内容const bodyImgData = this.getWindowContentData(videoWidth,videoHeight,containerWidth * this.dpr,containerHeight * this.dpr);if (bodyImgData == null) return;// 将body内容绘制到图片容器里imgContext.putImageData(bodyImgData, 0, 0);} else {// 对webrtc源提供的图像宽高进行修复let fixWidth = containerWidth;let fixHeight = (videoHeight * containerWidth) / videoWidth;if (fixHeight > containerHeight) {fixWidth = (containerWidth * containerHeight) / fixHeight;fixHeight = containerHeight;}// 对视频容器的内容进行裁剪fixWidth = this.wrcImgPosition.w > 0 ? this.wrcImgPosition.w : fixWidth;fixHeight =this.wrcImgPosition.h > 0 ? this.wrcImgPosition.h : fixHeight;imgContext?.drawImage(this.videoController,this.wrcImgPosition.x,this.wrcImgPosition.y,fixWidth,fixHeight);// 隐藏滚动条会出现部分内容未截取到,需要进行修复const diffHeight = containerHeight - fixHeight;if (this.hiddenScrollBar.state &&diffHeight > 0 &&this.hiddenScrollBar.fillState) {// 填充容器的剩余部分imgContext.beginPath();let fillWidth = containerWidth;let fillHeight = diffHeight;if (this.hiddenScrollBar.fillWidth > 0) {fillWidth = this.hiddenScrollBar.fillWidth;}if (this.hiddenScrollBar.fillHeight > 0) {fillHeight = this.hiddenScrollBar.fillHeight;}imgContext.rect(0, fixHeight, fillWidth, fillHeight);imgContext.fillStyle = this.hiddenScrollBar.color;imgContext.fill();}}// 初始化截图容器this.initScreenShot(undefined, context, this.screenShotImageController);let displaySurface = null;let displayLabel = null;if (this.captureStream) {// 获取当前选择的窗口类型displaySurface = this.captureStream.getVideoTracks()[0].getSettings()?.displaySurface;// 获取当前选择的标签页标识displayLabel = this.captureStream.getVideoTracks()[0].label;}// 执行截图成功回调if (triggerCallback) {triggerCallback({code: 0,msg: "截图加载完成",displaySurface,displayLabel});}// 停止捕捉屏幕this.stopCapture();// 重置光标状态document.body.classList.remove("no-cursor");}, this.wrcReplyTime);}

http://www.dtcms.com/wzjs/299528.html

相关文章:

  • 获取网站访客qq 原理网络营销个人感悟小结
  • 关于英文网站建设的请示友情链接平台
  • 重庆工程建设造价信息网站恢复原来的百度
  • 珠海正规网站制作系统最近的热点新闻
  • 新乡哪里做网站今日头条号官网
  • 技术支持 英铭网站建设宣传广告怎么做吸引人
  • 网站运营优化建议苏州百度推广开户
  • 莱芜专业做网站的关键词优化排名软件案例
  • 制作网站的步骤重庆网站建设软件
  • 网站建设方案书怎么写样版网站推广seo方法
  • php 企业网站cms长沙seo工作室
  • 做搜狗手机网站长尾国内优秀个人网站欣赏
  • 分销商城app开发seo推广有哪些方式
  • 免费的黄冈 投放平台有哪些宁波做seo推广企业
  • 网站建设推广哪家靠谱网站网络营销推广
  • 北京网站建设开发公司免费推广渠道有哪些
  • 南宁网站建设哪里有每日军事新闻
  • 北京住房与城乡建设部网站app广告推广
  • 网站怎么自己做推广国内手机搜索引擎十大排行
  • 成都学生做网站百度pc端首页
  • 学做电商的网站有哪些天堂网
  • 哈尔滨专业网站制作设计快速排名服务平台
  • 深圳国贸网站建设win7系统优化大师
  • 遵义市做网站的地方推广学院seo教程
  • 下载做ppt的动画片的好网站有源码怎么搭建网站
  • 武汉江夏区建设局网站宁波网站关键词优化公司
  • 网站2级页面怎么做seo排名优化哪家好
  • 广州网站建设-信科分公司企业网络营销推广案例
  • 六安网站建设优化域名流量查询工具
  • 网站开发项目有哪些怎么样做网站推广