Question

How Can I get a DOM reference to the canvas Handle. I'm using Delphi, IE11 and the corresponding MSMHTML Type library,I suspected it's along the lines of

canvasHandle := (HTMLDoc3.getElementById('canvas') as IHTMLCanvasElement);

the Html:

<canvas id="canvas">
  ....
</canvas>

however this throws an exception 'Interface not supported'

Was it helpful?

Solution

TWebBrowser control, by default uses IE7 standards/rendering mode.
You need to tell the control to use latest standards. There are a few ways of doing this.

Here are two of the ways known to me:

  • Either you specify FEATURE_<some feature> for your application in the registry (.e.g. FEATURE_BROWSER_EMULATION also a nice article here).

  • Add a "meta http-equiv-'X-UA-Compatible' content= edge" to the <head> block of a webpage to force Windows IE to use the latest standards.
    This will enable your HTML5 functionality working without the need for registry tweaks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top