Background2To3

这是个传入 2D 图片及其深度图得到 3D 背景图的组件

代码

<Background2To3
  picSrc="/images/2dto3d.jpg"
  depthSrc="/images/2dto3d_depth.jpg"
  :strength="3"
  selfStyle="width:780px; height:360px; top: 0; left: 0;z-index:1"
></Background2To3>


示例

Attributes

获取深度图open in new window

参数说明类型是否必要默认值
picSrc图片入口Stringtrue-
depthSrc深度图入口Stringtrue-
strength3D 效果强度Numberfalse2
adaptive是否开启自适应Booleanfalsetrue
canvasHeight画布高度比例Numberfalse1
canvasWidth画布宽度比例Numberfalse1
selfStyle自定义样式Stringfalse'width: 100vw; height: 100vh; position: absolute; top: 0; left: 0;z-index:-1'
picLoadedFn图片加载完成后的回调函数 ,默认传参 e 为图片信息Functionfalse-
mouseMoveFn鼠标移动触发事件,默认传参 e 为鼠标移动信息Functionfalse-
screenResizeFn页面窗口变化事件,默认传参 e 为页面窗口信息Functionfalse-
Last Updated:
Contributors: 袁袁袁一, YHao-o