简体   繁体   English

Firebreath 将 JPEG 图像放入插件 window

[英]Firebreath placing JPEG image inside the plugin window

I'm writing a plugin in firebreath, C++.我正在用firebreath写一个插件,C++。

I don't have any experience with both, so my question may be very basic.我对两者都没有任何经验,所以我的问题可能非常基本。

How do I place a JPEG image inside my plugin window?如何在我的插件 window 中放置 JPEG 图像? Or at least, how do I do it in C++ simple program?或者至少,我如何在 C++ 简单程序中做到这一点?

Thanks,谢谢,

RRR RRR

You can also use OpenGL to display images in plugin.您还可以使用 OpenGL 在插件中显示图像。 You can get several tutorials to load jpeg image in OpenGL as texture.您可以获得几个教程来将 OpenGL 中的 jpeg 图像加载为纹理。 Same code can be ported into the Firebreath plugin using the already given OpenGL sample plugin for windows.使用已经给定的 windows 示例插件,可以将相同的代码移植到 Firebreath 插件中。 Though OpenGL context creation will vary from one OS to the other.尽管 OpenGL 上下文创建因操作系统而异。 If you want to load jpeg images from web, you'll have to download image before converting it into opengl texture.如果要从 web 加载 jpeg 图像,则必须先下载图像,然后再将其转换为 opengl 纹理。

There are a couple of other questions that may help you better understand this:还有几个其他问题可以帮助您更好地理解这一点:

How to write a web browser plugin for IE, Firefox and Chrome 如何为 IE、Firefox 和 Chrome 编写 web 浏览器插件

Directx control in browser plugin 浏览器插件中的 Directx 控件

Basically you'll get a drawing model from FireBreath with the AttachedEvent.基本上,您会从 FireBreath 获得带有 AttachedEvent 的绘图 model。 Depending on your platform, you will draw to that window using platform-specific drawing APIs.根据您的平台,您将使用特定于平台的绘图 API 绘制到该 window。 On Windows, for example, you would get the HWND from the PluginWindow (cast it to a PluginWindowWin) and then draw to that.例如,在 Windows 上,您将从 PluginWindow 获取 HWND(将其转换为 PluginWindowWin),然后绘制到它。 Just make sure you stop drawing when DetachedEvent shows up.只要确保在 DetachedEvent 出现时停止绘图。

For more information, you'll need to be a lot more specific;有关更多信息,您需要更加具体; but follow those links and do some reading, then you'll know better what questions to ask.但是按照这些链接并做一些阅读,那么你会更好地知道要问什么问题。

FireBreath 1.5.2 was just released, btw! FireBreath 1.5.2刚刚发布,顺便说一句! Good luck!祝你好运!

Good luck!祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM