Reputation: 2301
Whats the best way of using images in SWT Browser component. Currently i stream the images to temp folder and use their location for displaying them. Is there any better way of using these images in the SWT Browser component, particulary images from the platform plugins.
Best Regards, Keshav
Upvotes: 0
Views: 960
Reputation: 5988
Convert them to a DataURI and insert them into the HTML directly.
http://en.wikipedia.org/wiki/Data_URI_scheme
Upvotes: 2
Reputation: 12718
If your plug-in is directory-based - rather than jar-based - you can use the files in the plug-in directly. The are several ways to find the file name of an resource entry of a bundle - I prefer FileLocator.toFileURL(URL)
which converts an URL on the format platform:/<plugin>/<path>
to a file:<filename>
... exactly what you need.
Upvotes: 1