0

I'm using CHtmlView (MFC wrapper class for IWebBrowser2) to show an SVG file, and wheel zoom is doing something crazy. If I hold down the Control key and spin the mouse Wheel UP, the image zooms IN at the mouse cursor, as expected. The problem is, spinning the mouse wheel DOWN does THE SAME THING. There appears to be no way to zoom OUT. I have tried every combination of control keys and none of them zoom out. If I open the SVG file in Internet Explorer, I get the exact same dumb behavior. I also tried using IWebBrowser2 directly (without CHtmlView) and again the behavior is the same.

I tried various SVG files, but they all exhibit the bug. If I open the same SVG file in Firefox, wheel zoom works as expected. So I conclude there's nothing special about the SVG file.

I tried using CHtmlView to open a PDF file, and again wheel zoom works fine in both directions. This leads to me believe that the problem is with whatever component Internet Explorer uses to display SVG files. What component is that? Is SVG support built-in to IE 10, or is it using a plugin?

I'm running Windows 7, Internet Explorer version 10.0.9200.16737. I tried using FEATURE_BROWSER_EMULATION to change the IE version to 10000 for my application but it made no difference. I didn't expect it to help, since Internet Explorer also exhibits the bug by itself, without my application.

I looked into the possibility of writing custom zoom code, but it looks dubious, because my requirement is not merely to zoom in/out, but to zoom in/out at the pointer position. Code such as ExecWeb(OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DODEFAULT, &vZoom, NULL); is unlikely to solve my problem, because there is no parameter for the current pointer position.

I searched on this problem for hours and astonishingly did not find any relevant information. I can't believe I'm the first to notice this behavior, UNLESS it's only happening to me because there's something unique about my OS configuration.

  • Could you show your issue with a screenshot and some related codes? This will be easier for us to understand and help with you. Besides,about the SVG's compatibility with IE. You may check from this:https://caniuse.com/#search=svg – Jenifer Jiang Jan 16 '19 at 10:09
  • Thanks for the reply, but there's nothing to show. For SVG files ONLY, Ctrl + wheel zooms in, but never out (regardless of wheel spin direction) using Windows 7 with IE 10. Both IWebBrowser2 and IE exhibit the behavior. Other browsers (e.g. Firefox) wheel zoom correctly when displaying the same SVG file. Other files types (e.g. HTML, PDF) also wheel zoom correctly in IE 10. SVG wheel zoom works correctly in Windows 8 (IE 11) and Windows 10 (Edge), at least on the systems I tried. Evidence points to an error in the IE 10 SVG support. – victimofleisure Jan 28 '19 at 20:50

0 Answers0