如何在 IE9 中重绘/重绘指向 DOM 中图像元素的 IHTMLElement?
我有一个有效的 IHTMLElement 对象,它指向 IE9 中的图像。图像数据最近通过IDirectDrawSurface更新。我正在尝试找到一种方法来强制 IE9 在更新图像数据后重新绘制 DOM 中的图像。谁能指导我一种强制重新绘制以这种方式更新的图像的方法?
我尝试过的方法:
HRESULT ret = pElement->get_style(&pStyle);
pStyle->put_visibility(L"hidden");
pStyle->put_visibility(L"visible");
// Or
pStyle->put_display(L"none");
pStyle->put_display(L"block");
感谢您的宝贵时间,任何提示将不胜感激。
-将要
I've got a valid IHTMLElement object that points to an image in IE9. The image data was recently updated via an IDirectDrawSurface. I'm trying to find a way to force IE9 to repaint the image in the DOM after I update the image data. Could anyone please direct me to a method of forcing a repaint of an image that has been updated in this fasion?
Approaches I've tried:
HRESULT ret = pElement->get_style(&pStyle);
pStyle->put_visibility(L"hidden");
pStyle->put_visibility(L"visible");
// Or
pStyle->put_display(L"none");
pStyle->put_display(L"block");
Thanks for your time, and any tips would be greatly appreciated.
-Will
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过重置元素的 src ?据我所知,如果您设置已经存在的相同 src,IE 将不会执行任何操作,但看起来它可能会被欺骗;
Have you tried resetting the src of the element? From what I can see, IE won't do anything if you set the same src that is already present, but looks like it can be tricked;