Skip to content

Screenshot Feature #30

Answered by roerohan
candiedoperation asked this question in Q&A
Discussion options

You must be logged in to vote

In #26, I've exposed the rfb object. So, if you have a code snippet like:

function App() {
  const vncScreenRef = useRef<React.ElementRef<typeof VncScreen>>(null);

  return (
    <VncScreen
      url={vncUrl}
      scaleViewport
      debug
      ref={vncScreenRef}
    />
  )
}

You can access the rfb object using vncScreenRef.current?.rfb. If the rfb object isn't set, it's value is null.

You can now use vncScreenRef?.rfb?._canvas.id = canvasId;

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by roerohan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #24 on February 27, 2022 11:57.