有没有办法能够使用ReactComponent获取更新/修改过的图像对象? 目前,PESDK React版本仅支持UI自定义。 在PhotoEditor中编辑图像后,我可以使用ReactComponent获取导出的对象,以便将其集成到现有的反应组件中吗? 我在PESDK文档中找不到任何解决方案。
如果有人知道解决方案,请告诉我 或者PESDK正在进步中吗?
由于
答案 0 :(得分:0)
这样的事情应该有效:
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
}} />)
}
}
&#13;