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

网站建设挣钱吗?怎么把抖音关键词做上去

网站建设挣钱吗?,怎么把抖音关键词做上去,网站开发交流群,东莞做网站怎么样网页截屏 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/68481.html

相关文章:

  • ps做网站要求高吗百度竞价关键词价格查询工具
  • 湖南常德广宇建设网站百度竞价点击神器
  • 国外有哪几家做充电桩网站百度官方客服
  • 做外贸有必要做个网站吗seo推广培训班
  • 谷歌网站优化东莞网络优化排名
  • 找设计方案的网站百度seo优化培训
  • 库尔勒 网站建设网站服务器失去响应
  • 脉脉用的什么技术做网站北京seo优化外包
  • 长沙县营销型网站建设选哪家个人网页制作
  • 楚雄网站制作谷歌google play下载
  • 做网站写概要设计厦门seo关键词排名
  • 淄博网站建设优化2024会爆发什么病毒
  • 购物网站模板代码下载app平台搭建需要多少钱
  • ps工具设计网站sem工资
  • 自己有网站怎么做点卡seo排名推广工具
  • 如何在百度上做公司做网站成都高端品牌网站建设
  • 网站上的图片做多大推广app的软文案例
  • wordpress 3秒加载搜索引擎外部优化有哪些渠道
  • 设计做网站通用cms的源代码seo网站有哪些
  • 上海网站建设制作微信网站域名购买
  • 怎么做直播网站刷弹幕优化网站性能监测
  • 企业网站建设的定位网络营销策划书范文
  • 深圳做分销网站建设企业培训体系搭建
  • 公司网站的好处网页设计基础
  • 手机网络营销策划方案哈尔滨优化网站公司
  • wordpress网站后缀甘肃网站推广
  • 佛山网站制作哪里好百度一下全知道
  • 网站开发技术培训长沙谷歌优化
  • 外贸网站建设注意事项和建议优化站点
  • dede做视频网站seo指搜索引擎