[squeak-dev] Modern way to load a picture from the web?
Marcel Taeumel
marcel.taeumel at hpi.de
Thu Mar 21 13:23:40 UTC 2019
What about ...
Form fromBinaryStream: (WebClient httpGet: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Squeak-x11.png/617px-Squeak-x11.png') contentStream.
... I think we should add a #fromUrl: besides Form class >> #fromFileNamed: and there distinguish between file paths and HTTP urls etc:
Form fromUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Squeak-x11.png/617px-Squeak-x11.png'.
Best,
Marcel
Am 21.03.2019 11:51:58 schrieb H. Hirzel <hannes.hirzel at gmail.com>:
Hello
What is a good modern way in Squeak to load a picture from the web?
I am looking for an equivalent of
| pngPicURL aStream |
pngPicURL := 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Squeak-x11.png/617px-Squeak-x11.png'.
aStream := HTTPSocket httpGet: pngPicURL.
(ImageReadWriter formFromStream: aStream) asMorph openInHand
And answer or just comments are welcome.
Thank you.
Kind regards
Hannes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190321/5ec88c0f/attachment.html>
More information about the Squeak-dev
mailing list
|