Correct img format for browser widget.

James Hale james at thehales.id.au
Sun Jul 16 07:53:51 CEST 2017


hh wrote:

> ... Or in case you meant simple HTML load (not canvas2d):
> 
> <img src="...">
> where src = "full http-path to image" (local server is running)
> or src = "relative path to image"

Actually I am not loading a file from a server, I am setting the htmltext of the widget.

The file I am loading is actually a markdown which I convert to xhtml using mergMarkdownToXHTML.
I then set the htmltext of the widget to this converted content.
Now the text etc all display fine as I would expect, however the images don't.
The image tags in the markdown are correctly converted to <img src="..."> but obviously the path to the image file is not being correctly interpreted by LC.
If I was to display this in a text field (by setting its htmltext) I would need to change the img tag's src attribute to include the "binfile:/" prefix.
When I do this the image displays as expected in the text field.

However, this displays the images at the size they exist on disk.

I notice the dictionary (which is using the browser widget) does not do this. It actually scales the images down where required.
So I thought rather than set the htmltext of the field, let me set the htmltext of a browser widget.
However none of the forms of the URL for the images that I have tried work.
I do not know javascript and while I can sort of follow the logic behind the guide display in the dictionary I can't fathom how it actually works.
It is taking the markdown, converting it the a form of html and it correctly shows the text and the images.
I am trying to do this without the javascript.


James







More information about the use-livecode mailing list