为什么 Carbon 的 HTML 渲染库无法显示图像
我有一个旧程序,它使用 Carbon 的 HTML 渲染库显示嵌入式浏览器。我正在使用 10.4 SDK 将其从 codewarrior 迁移到 Xcode。虽然 HTML(包括链接)显示正确,但图像就是不显示。我可以看到替代内容,并且尺寸已使用宽度和高度字段正确设置。
我正在使用以下命令进行初始化:
OSErr err = HRNewReference(m_HRRef, kHRRendererHTML32Type,
GetWindowPort((WindowRef) m_pWindow));
然后我使用以下命令打开本地 HTML 文件:
err = HRGoToFSRef(m_HRRef, &f, false, false);
我的图像也存储在本地,但只是不出现,它之前在我的仅 ppc codewarrior 编译上运行良好。
我尝试使用 HRGoToURL 访问 Internet 上的网页,并尝试将图片 src 字段替换为 http:// 或 file:// 图像(jpg、gif 和 png 格式)链接,但始终得到相同的结果。
您知道这样的问题吗?我知道我可以而且可能应该迁移到 WebKit,但这会让我更加投入。
西尔万
I have an old program that shows an embedded browser using the HTML Rendering library from Carbon. I am migrating it from codewarrior to Xcode, using the 10.4 SDK. While the HTML is displayed correctly, including links, the images just don't show up. I can see the alt content, and dimensions are properly set with the width and height fields.
I am doing the initialization with:
OSErr err = HRNewReference(m_HRRef, kHRRendererHTML32Type,
GetWindowPort((WindowRef) m_pWindow));
And then I open my local HTML file with:
err = HRGoToFSRef(m_HRRef, &f, false, false);
My images are also stored locally but just do not appear, it was working fine previously on my ppc-only codewarrior compilation.
I tried with web pages on Internet with HRGoToURL, and I tried replacing my pictures src fields with http:// or file:// links to images, in jpg, gif and png, always with the same result.
Are you aware of any issue like this? I know I could, and probably should, migrate to WebKit but that would me more involved.
Sylvain
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是在黑暗中拍摄的(我完全不熟悉 HTMLRenderingLib),但它让我想起 这个。也许这里它也不会异步加载图像,甚至是本地图像;您是否尝试过让运行循环循环(无论哪种方式最适合您的应用程序:WaitNextEvent,返回主运行循环,旋转子事件循环,...)并查看图像是否加载?
This is a shot in the dark (I am completely unfamiliar with HTMLRenderingLib), but it reminds me of this. Maybe here too it doesn't load images, even local ones, asynchronously; have you tried letting the run loop loop (whichever way is most appropriate to your app: WaitNextEvent, return back to the main runloop, spin a sub event loop, …) and see if the images load?