Save current bing map view as an image - ajax

I am using Ajax Bing maps 7.0 and I'd like to generate an image from the current map view and then upload it somewhere. Is there any way to do this?

depending on how complex your map is (in terms of what data you are showing on it) you are better off using the static map service to generate an image that matches your ajax map:
http://msdn.microsoft.com/en-us/library/ff701724.aspx

Related

Loading the first 5 images from google with specific keyword

I'm trying to load the first 5 image that comes up on google when I type a given keyword in my app. So let's say if the keyword was "Butter" I want to load the first 5 images that com up on google if you type butter.
I've been looking at the Github project SDWebImages (https://github.com/rs/SDWebImage), but it looks like you can only load the images if you have the url of the image.
Anybody know how I can do what I described, or anybody that can point me in the right direction as to what I should look at to do it.
Google has deprecated their image search API and you are now supposed to use custom search which supports images. You will need to sign up for an API key. When you make your search request you need to set your searchType parameter to image.

Designing Web Album: CSS or Ajax?

I want to design a web album with every image in the album having it's own title, and description. So, at a time only one set of image, title and description would be visible. And on clicking next button, the next set of image, title and description would appear,and so on.
So am wondering, what would be the best way to design with? HTML or AJAX?
I don't want to use the ready to use tools such as lightbox.
Do you want the browser's back button to work? If so, then you should make your life simple
and use html (since you will only be displaying one image at a time either way).
Ajax implies using html. On the other hand, using html does not necessarily imply that you need to use AJAX to load content dynamically.
What is the purpose of this project? If you are doing it for the learning experience you should go on with AJAX (from scratch). If you want speed and quality use an existing web image gallery. If you need to write it yourself use plain html (or an ajax framework such as dojo, jquery, etc. this will save you a lot of pain solving cross-browser quirks).
In addition, if you want to be able to click a button to take you to the next (previous) image
and you don't know how many images you will have beforehand, then you are looking for dynamic behavior. You can code dynamic logic either on the client side (javascript), or on the server side (let's say "php" to start with).
Also, how do you plan to keep the corresponding (image, title, description) together?
If you only have a 3 images, say you could hard code each of this into its corresponding html file. eg. 1.html, 2.html, 3.html. Then you would have to point the forward button from a.html to point to b.html. etc...
If you didn't want this boring static behavior and wanted something smarter, say you decided for AJAX. Then you would only have 1.html file and from there (using javascript) you would ask your server for the (image, title, description) and load all that (dynamically, without refreshing the browser) into the same page. The easiest way to get this from the sever is by just reading a a static (XML, or JSON) file which contains all the info (image urls, titles, descriptions). Then with javascript and using DOM manipulation you would remove the old image, and add the new one.
However, this would all be a lot simpler with server-side processing (and it's worth learning). In this case you could have a url which takes a parameter with the image number. eg. http://example.com/gallery/index.php?image=X
then before the server responds to the client with the html, it would realize that you want to load image X so it would get it's corresponding description, title, and url. and "embed" those into the file. Of course, depending on the number, it would also add the right links for the previous and next buttons. Eg. If the currently displaying image was 9 then forward button would "dynamically" be determined to link to (X+1) : http://example.com/gallery/index.php?image=10

Preload the Image in the webbrowser of windows phone

I'm designing a news-reading app and using the NavigateToString() of a webbrowser to show some string. Now I want to implement the off-line reading function, the html string had already been downloaded, except the image.
Windows phone has implemented the image-cache function, once the Image is requested, it had been cached. But now problem is that, all the html strings are stored in a array, some of those html strings hadn't been shown throught the navigateToString(), namely the imgs in those string couldn't show up if the internet is disconnected.
So I'm wondering how to cache the imgs in the webbrowser?
thanks,
ellic
It ain't gonna be easy or pretty.
Here's one thing you can do...
Parse the HTML using something like the HtmlAgilityPack. Linq should be a good solution for finding all the images. If you want to use xpath, you can do that too.
Find all Images in the HTML and use a WebClient (or better yet, a WebRequest) to fetch them.
Save them as part of your database that you use to store your HTML strings (say, Base64 encoded if your medium needs to be strings, key'ed by the URI to the image);
When you want to display the offline HTML, again, parse the HTML and replace all references to images with the data protocol equivalent of your cached images.

Google maps and Umbraco: Many markers?

I am creating a Google Map in a Umbraco solution. I have around 1000 markers to be displayed on the map, and all data for the markers are stored as individual nodes in Umbraco. What is the best way, performance wise, to pull out and display all these markers? It should also be possible to segment on the markers shown, ie., different categories etc.
You should look at retrieving the nodes with an XSLT or Razor macro, and transforming the list of details (lat/long etc.) into a Javascript array, which you then pass to the Google Maps Javascript constructor. Darren Ferguson, the creator of the Google Maps datatype for Umbraco, has a great blog post demonstrating how to achieve this with a single marker, which could be easily adapted for multiple markers.

Bing Image Search API filter by image size

I'm working with Bing Image Search API using jsonp with jquery $.ajax. I'm able to retrieve the search results. But I'm unable to find a way to filter results by image size. I can't find anything about this in the documentation. Does anyone know if there is a way to filter results by image size or do any type of filtration for that matter.
You can do Image.Filters=Size:Small to filter by small images, you can also use medium and large.
Here's a more complete sample (The selected answer led to this) that might be helpful to someone who runs into this problem in the future:
request.Image = new ImageRequest();
request.Image.Filters = new string [1] {"Size:Small"};
More options to add to the "Filters" array can be found here.
HTH.

Resources