简体   繁体   中英

Firebreath placing JPEG image inside the plugin window

I'm writing a plugin in 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? Or at least, how do I do it in C++ simple program?

Thanks,

RRR

You can also use OpenGL to display images in plugin. You can get several tutorials to load jpeg image in OpenGL as texture. Same code can be ported into the Firebreath plugin using the already given OpenGL sample plugin for windows. Though OpenGL context creation will vary from one OS to the other. If you want to load jpeg images from web, you'll have to download image before converting it into opengl texture.

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

Directx control in browser plugin

Basically you'll get a drawing model from FireBreath with the AttachedEvent. Depending on your platform, you will draw to that window using platform-specific drawing APIs. On Windows, for example, you would get the HWND from the PluginWindow (cast it to a PluginWindowWin) and then draw to that. Just make sure you stop drawing when DetachedEvent shows up.

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! Good luck!

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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