开发者

How to fetch image from URL (HTTP) in c++? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

How can I fetch an image from a URL in c++ and store it on harddisk? Thanks.

I am working in the openGL environment in c++ so that code is not related to my question. All i want to do is fetch some image from a URL and store it on my hard disk.

Which is the Google Map static map API which i want to use to fetch the image and store.

Sample request URL would be: http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap &markers=color:blue%7Clabel:S%7C40.702147,-74.0开发者_开发百科15794&markers=color:green%7Clabel:G%7C40.711614,-74.012318 &markers=color:red%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284&sensor=false


C++ isn't PHP and has no means to do that itself. You'll have to use the platform API at least (to open a socket, which isn't a part of the C++ standard), and better yet, use a third-party library — for example, with Qt you could do that in a few lines.


You could use a library such as libcURL.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜