I know how to download images from web and set them as textures
i want to know how to download images of specific size.
Here’s the scenario
i want all images, that are to be downloaded of 120x120.
but if the url corresponds to an image that is 1200x1200 i want to still download it but in 120x120.
because ill be saving these images to the device that is why i want all images to be of of small size.
Unless the webserver has a special endpoint that serves a smaller image, you have to pull the full image down and resize it on the device.
Luckily it appears someone else has made a class to do just this thing!
http://wiki.unity3d.com/index.php/TextureScale?_ga=2.268976433.1389015227.1570932857-886726940.1475123092
There might also be another web-based image scaler website you could use, basically a site that accepts an arbitrary URL and gives you a different-sized version of the image.
1 Like
This is gold. Cheers lad.
Which one should i choose? point or bilinear?
i am downloading leaderboard profile images(120x120) from web url and then saving the images to the device.
Try 'em both! One filters it, one does not.
I’m confused, why wouldn’t you just add a dimension parameter to your webserver and do the scaling there. It gives you the added benefit of being able to cache the icons.
1 Like
Sorry, i dont follow. What are you saying.
Instead of directly pulling an image like this
Www.myserver.com/my/image.png
write a small server in php or java that’ll find the image for you and can do manipulation on it.
www.myserver.com/getimage.php?image=my image.png&size=120.
yeah, the images i was talking about are leaderboard images. there’s no centralized server where we are keeping these images. Each picture is coming from different server. FB etc.
We dont have a server, we are using playfab as backend. we just have the url of the picture and we are downloading it manually in the game.