Re: using IDLnetURL to get an image from a HTTP URL into IDL [message #91366 is a reply to message #91365] |
Mon, 06 July 2015 01:27   |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Monday, July 6, 2015 at 10:01:40 AM UTC+2, Puneeth Shankar wrote:
> I was hoping for some help on ways to get an image(say a screen shot of google maps) from a URL and save it onto the hard disk.
> Currently I'm able to :
> 1)Save the entire http code of a URL to disk(if I want to)
> 2)Save an image from "URls' that straightly lead to images" for ex: ( http://d335hnnegk3szv.cloudfront.net/wp-content/uploads/site s/501/2014/11/Balloons21.jpg )
> Note: Using the below snippet will give you an idea of what i have achieved so far:
>
> Url = ' http://chart.apis.google.com/chart?chs=200x100&cht=p& ;chd=t:10,20,30'
> ourl = obj_new('IDLnetURL')
> png = ourl->get(filename='E:\temp\gchart.png', url=url)
> obj_destroy, ourl
> im = read_png('gchart.png')
> window, xsize=200, ysize=100
> tv, im, true=1
Hi,
I don't understand your question. What was the question again?
If you want to display and save the image AND you have idl version 8.xx then
I would use the following lines:
i = image(im, dimensions=[200,100], margin=0, /no_toolbar)
i.save, 'gchart.jpg', width=200
The save method allows saving in lots of formats, see http://www.exelisvis.com/docs/save_method.html
The thing is, you already have a save image, so I don't think that this is what you're looking for.
If you're trying to get images from google maps, you should have a look at David's article: http://www.idlcoyote.com/map_tips/googlemap.php
(for this, and many other applications, you will need David's Coyote library)
I hope this helps (but I doubt it).
Cheers, Helder
|
|
|