Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to display QPixmap on a canvas element in a QWebView window?
pmh4514 last edited by
I'm experimenting with QtWebKitBridge and have a basic testbed working. I have a Qt form with a button that loads a file from disc into a QPixmap and the embedded QWebView then loads that QPixmap into an <img> tag.. This much works.
I drill into my webview:
This works exactly as I'd expect.. The image that was loaded in the Qt context is displayed in the embedded webKit browser in "imageElement"
But I don't want it on an image element, I want it on an html5 canvas element
So if in my HTML, I also include:
<canvas id="myCanvas" width="400" height="410"></canvas>
Then how do I load my QPixmap into the canvas?
I tried the following, but it crashes:--
var context = document.getElementById("myCanvas").getContext("2d");