简体   繁体   中英

eclipse plugin: add image to browser

I have created an Eclipse plugin which displays a browser with a URL as follows:

browser.setBounds(0, 0, 100, 100);
browser.setUrl("https://www.stackoverflow.com/");

Also I am able to get the animated image from the bundle as follows:

Image image = ImageDescriptor.createFromURL(FileLocator.find(bundle, new Path("icons/sample.gif"), null)).createImage();

How could I add the Image to the browser on run time execution?

Since you're setting the Browser widget to display a URL, the widget will display the contents of that URL.

If you want to display your own content, you'll have to use the setText() method.

Perhaps you can create html that includes the URL you want in an IFRAME and compose the rest of the html with your own content?

As for the image, I'm sure there are ways to include the image in the constructed HTML ... or you can base64 encode the data and include it in the constructed HTML. See Can I embed a .png image into an html page?

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