Hello Everyone,
We are currently working on 3d map of a city, where we want to display photos of various locations. We have a json file with URL links to photos and we want to read the image from the website to project onto the geometry.
I have seen that it is possible to load images from links in older posts (or so I think) but the posts are quite dated and I don’t know if it still works or how for that matter.
Does anyone have any idea on how I would approach this?
Best,
Paul
Yo!
For that you should make an HTTP GET request to that URL. You should then get the content of that image as a sequence of byte and make a Texture/SKImage (depends on your setup) out of it.
Using the HTTPGet node that ships with vvvv, it would look like this :
We’re using ForEach [Reactive]
to react when we get a response, and in there we get that list of bytes and make a Texture
out of it using TextureDecoder
.
This is just a simple example to show you the workflow, you would then have to check for responses that are not 200 OK
, etc.
If the HTTP node is not enough for you, you might wanna try the VL.SimpleHTTP
. It has a help patch showing how to retrieve an image.
GetImageFromUrl.vl (9.2 KB)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.