Re: Correct img format for browser widget.

2017-07-17 Thread james--- via use-livecode
Hi Jonathan, Cool. Works a treat and no need for array. Using a percentage also means I can allow the browser widget to be resized. Very cool. img { Max-width: 90%; } James On 17 Jul 2017, at 22:00, jonathandly...@gmail.com wrote: > Just a quick note - you can set the max-width of images

Re: Correct img format for browser widget.

2017-07-17 Thread Jonathan Lynch via use-livecode
Hi James, Just a quick note - you can set the max-width of images in CSS. That will limit their size with just one line. Sent from my iPhone > On Jul 16, 2017, at 11:42 PM, James Hale via use-livecode > wrote: > > Thank you so much Hermann and Jonathan > > It took me a little time but I wor

Re: Correct img format for browser widget.

2017-07-17 Thread Jonathan Lynch via use-livecode
It sounds like the dataURL method costs about a tenth of a second per image, for moderately large images. I had never tested that, but it's good to know. For my purposes right now, that is not an issue, but it could be for plenty of situations. Sent from my iPhone > On Jul 16, 2017, at 11:42

Re: Correct img format for browser widget.

2017-07-16 Thread James Hale via use-livecode
Thank you so much Hermann and Jonathan It took me a little time but I worked out what to do after looking at your suggestions. The fact that setting the htmltext of the browser widget breaks the img URL's makes sense from a security and logical point of view. I then tried Jonathan's technique

Re: Correct img format for browser widget.

2017-07-16 Thread hh via use-livecode
An option for James could be to put ONE html-file in the images folder with content: And then set any image of that images folder by changing the HTML by javascript: on mouseUp put "flower2.png" into nn -- give the name directly put line 42 of myImages into nn -- a list containing the image

Re: Correct img format for browser widget.

2017-07-16 Thread Jonathan Lynch via use-livecode
James - if you look at the example stack on LiveCode share "browser widget image manipulator" it has some LC code for creating a dataURl for an image. Use that to create the data URL for the image. Basically: Get the image info from the image file like this: Put URL "binfile:imagepath" into

Re: Correct img format for browser widget.

2017-07-16 Thread hh via use-livecode
> Jonathan wrote: > Is this part of the same-source policy for web pages? The HTML file and the > image file > needing to be in the same folder? No. I wrote this only because the example used a relative path pointing to the same folder: > Example htmltext of the widget or text of the file "flow

Re: Correct img format for browser widget.

2017-07-16 Thread Jonathan Lynch via use-livecode
So - thinking about this dime more - the browser widget uses a dummy URL if not told to load a specific URL, and the dummy URL would not have permission to access local drives, for security reasons. That would mean the "file:///" prefix would not work either. So he would have to either save the

Re: Correct img format for browser widget.

2017-07-16 Thread Jonathan Lynch via use-livecode
Hi Hermann, Is this part of the same-source policy for web pages? The HTML file and the image file needing to be in the same folder? Sent from my iPhone > On Jul 16, 2017, at 5:45 AM, hh via use-livecode > wrote: > > You can have that without a (local) server when using a browser widget. >

Re: Correct img format for browser widget.

2017-07-16 Thread Jonathan Lynch via use-livecode
One other solution... You can convert the image source to a data URL. You can construct the htmltext for the dataurl in LC, and replace the current image SRC information with dataURL SRC information. Then, when you set the htmltext of the browser widget, the images will show up without needing

Re: Correct img format for browser widget.

2017-07-16 Thread Jonathan Lynch via use-livecode
Hi James, Can you post an example of your actual filepath? With HTML, the first part of the path to the local disk usually looks like this: "file:///C:/users/pictures/mypicture.png" LC should be able to give you the right full path to a document- but make sure to try using the "file:///" prefi

Re: Correct img format for browser widget.

2017-07-16 Thread hh via use-livecode
You can have that without a (local) server when using a browser widget. Although you can NOT display an image from disk without javascript by only setting the htmltext with a correct filepath, for example as follows. (This is a browser engine thing, can not be influenced by the widget.) Example h

Re: Correct img format for browser widget.

2017-07-15 Thread James Hale via use-livecode
hh wrote: > ... Or in case you meant simple HTML load (not canvas2d): > > > 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 act

Re: Correct img format for browser widget.

2017-07-15 Thread hh via use-livecode
... Or in case you meant simple HTML load (not canvas2d): where src = "full http-path to image" (local server is running) or src = "relative path to image" for example: src="http://localhost:/tests/images/myimage42.png"; src="../images/myimage42.png" The relative path has to be relative to

Re: Correct img format for browser widget.

2017-07-15 Thread hh via use-livecode
You have to set it in the HTML, with HTML-syntax. LC Script may help with that by sending the imagedata to the HTML page. Examples how to do this can be found (look at handler "chooseScript" in the card's script and make the widget or revBrowser display visible) as follows. [a] using a browser w

Correct img format for browser widget.

2017-07-14 Thread james--- via use-livecode
Can someone tell me the correct format for an image src tag to use with the browser widget? I have a folder of HTML and an associated folder of images yet I am unable to get the images to show. They are .png. I have tried Src = "full path to image" Src = "relative path to image" Src ="file://ful