有什么方法可以使用ReactComponent来获取更新/修改后的图像对象吗?当前,PESDK React版本仅支持UI定制。在PhotoEditor中编辑图像后,是否可以使用ReactComponent获取导出的对象,以便将其集成到现有的react组件中?我在PESDK文档中找不到任何解决方案。
如果有人知道解决方案,请告诉我还是PESDK正在进行开发?
谢谢
这样的事情应该起作用:
import React from 'react'
import ReactDOM from 'react-dom'
window.React = React
window.ReactDOM = ReactDOM
import PhotoEditorUI from 'photoeditorsdk/desktop-ui'
// import PhotoEditorUI from 'photoeditorsdk/react-ui'
class ApplicationComponent extends React.Component {
// Call this when you want to export the editor image
export () {
this.editor.ui.export()
.then(image => {
// Image code here
})
}
render () {
const { ReactComponent } = PhotoEditorUI
return (<ReactComponent
license='PUT YOUR LICENSE KEY HERE' // e.h. '{"owner":"Imgly Inc.","version":"2.1", ...}'
ref={c => this.editor = c}
assets={{
baseUrl: '/node_modules/photoeditorsdk/assets'
}}
editor={{image: this.props.image }}
style={{
width: 1024,
height: 576
}} />)
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句