簡體   English   中英

使用react-konva翻轉圖像

[英]Flip Image with react-konva

https://github.com/lavrton/react-konva

我正在使用此功能(水平或垂直)翻轉圖像,但無法正常工作:

  flip = direction => {
    this.setState({
      width: -this.state.width
    })
  }

最好使用scale屬性:

<Image image={this.state.image} scaleY={-1} y={200}/>

因此,在您的狀態下,應存儲帶有1或-1值的scale屬性,

https://codesandbox.io/s/v6yk2j2w0l

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM