how can I load a website url into an image control
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
how can I load a website url into an image control
Hi,
Instead of using the browser widget to load a url, how can I load a website url into an image control?
I have a scroller as a graphical menu, however the scroller doesn't work when i have a browser in the scroll group. Therefore at the end of the scrolling graphic menu I want to add a image control linked to a URL website. The image control will display a blog article with graphics and text from the website, which will be included in the scrolling graphic menu.
Thanks,
Bevan.
Instead of using the browser widget to load a url, how can I load a website url into an image control?
I have a scroller as a graphical menu, however the scroller doesn't work when i have a browser in the scroll group. Therefore at the end of the scrolling graphic menu I want to add a image control linked to a URL website. The image control will display a blog article with graphics and text from the website, which will be included in the scrolling graphic menu.
Thanks,
Bevan.
Re: how can I load a website url into an image control
Just throwing this out there, but couldn't you load the page in the browser control, then export a snapshot of it and import that snapshot into the image control?
Seems like a clunky way to go about it though..
Seems like a clunky way to go about it though..
Re: how can I load a website url into an image control
thanks for the suggestion, a good idea but a bit clunky like you said, can you load into a browser and instead of import/export can you set the image control to browser contents?
Re: how can I load a website url into an image control
Code: Select all
put URL "http://www.runrev.com/images/logo.jpg" into image "web"
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: how can I load a website url into an image control
Yes that would work Max, but only for an image you have an address for. I am pretty sure the OP wants to load an actual page into an image object.
Sorry Bevan, I never did find any less clunky way to do this.
Sorry Bevan, I never did find any less clunky way to do this.
-
- VIP Livecode Opensource Backer
- Posts: 9840
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: how can I load a website url into an image control
The literally millions of machine instructions needed to download all of the elements of a web page and render them is inherently time consuming.
There is no magic pony to make that much simpler. Web page rendering is a very complex task.
Though it may seem klunky, given the complexity of the task Bogs' suggestion is about as simple as nearly anything you'll find for this anywhere on this planet.
There is no magic pony to make that much simpler. Web page rendering is a very complex task.
Though it may seem klunky, given the complexity of the task Bogs' suggestion is about as simple as nearly anything you'll find for this anywhere on this planet.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: how can I load a website url into an image control
I'm sure Hermann put up a scrolling browser thumbnailer stack somewhere, didn't he?
Re: how can I load a website url into an image control
Dunno, but if anyone would have, I'm sure it would be Hermann
For Firefox, the cli would be
I know Firefox (and probably most other browsers) have the ability to produce an image of a webpage in full, so I suppose if you can find out a cli way of initiating it, then put it on your card as a group, you'd have a picture of the webpage with the ability to scroll it as well.FourthWorld wrote: ↑Tue Apr 23, 2019 1:29 amThough it may seem klunky, given the complexity of the task Bogs' suggestion is about as simple as nearly anything you'll find for this anywhere on this planet.
For Firefox, the cli would be
The only problem there of course is determining what browser the user might have on their system, because for it to work, you'd have to know which command to issue. Of course, it would also depend on whether you were able to use shell or not to issue the command. I know it doesn't work on some 'nix and mac systems.Boolean World
Firefox
Firefox 57 and later versions features a command-line screenshot mode. Just like pageres-cli, Firefox captures webpages accurately, but it doesn’t have as many features. This mode doesn’t make use of a graphical environment, which makes it well-suited for usage on servers.
To take a screenshot with Firefox, run:
firefox -screenshot google.png google.com
This creates a full-page screenshot of google.com to the file google.png. At present, Firefox doesn’t support creating screenshots in other formats. If you use a different extension like google.jpg, it will create a PNG file with that name.
To take a size-limited screenshot, use the --window-size parameter. For example, if you want to generate a screenshot of size 1366×768, run:
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: how can I load a website url into an image control
This is very simple with LiveCode
= use javascriptHandlers for scrolling the page,
= export snapshot for generating the corresponding image part,
= build the image from the image parts.
See
viewtopic.php?p=174346#p174346
= use javascriptHandlers for scrolling the page,
= export snapshot for generating the corresponding image part,
= build the image from the image parts.
See
viewtopic.php?p=174346#p174346
shiftLock happens
Re: how can I load a website url into an image control
I *knew* there was a magical Hermann solution somewhere close at hand
-
- VIP Livecode Opensource Backer
- Posts: 9840
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: how can I load a website url into an image control
Yes, it's very well done. As Bogs suggested, it relies on a browser engine (Widget) to render the page, then uses LC's snapshot to obtain the rendered page image.
Though Bevan had considered this method clunky, I can't imagine attempting to render modern HTML without a browser engine. And in Hermann's capable hands, LC is shown to provide this about as easily as it can get.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn