Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Fern Sanchez   on Aug 03 In Asp.net Category.

  
Question Answered By: Adel Fischer   on Aug 03

Your page downloads with the image.

You click  the button and it posts back and gets a new page, and that page opens
up a new window with the image.

Question :: how does that window get the image ? what is in that window ? how
did the html code in that new window get there ?

If you open that window with an url, then it has to go back to the server to get
the actual image - which is another trip.

What happens is this Mark, if you think about it. I we click any sort of button
that posts back to the server with the co-ords - then that delivers a web page
to the browser but NOT with the image - with the image url - that image url then
has to go back to the server again to actualy get the binary image data.
(it would be different if we could send the coords to the server and get the
image straight back .... but this would involve an embedded image (which you can
do in mht files but not htm files ... i.e. <img
src='lotsofgobbeldygookbinarybase64here'>
So it's a bit different to collecting data.

Better is this.

Click the button, but one which doesn't post  back to the server but opens up a
new window, in that new window write code to fetch the image.


function OpenWin(){
var item = document.images.im;
var ww = yourwindowwidth
wh = yourwindowheight
var props =
'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,\
width=';
props += ww;
props += ',height=';
props += wh;
props +=',left=270,top=270';
detail=open('','MyClipping',props);

var bod = "<BODY>\n";
bod += blablahblahblah
bod += "<img src='" + dynamicimages.ashx??x1=p1&x2=p2&y1=p3&y2=p4 +
"' id='im'>\n";
bod += blablahblahblah
bod += "<\/BODY>\n";
detail.document.write(bod);
}

So that the way I've domn eit except that there is no button, I have caputered
mouse events and when I drag across a specified image it grabs mouse down and
mouse up points and opens the new window with those points written into the code
- so then that window opens client side immediately and fetches the image from
within itslef.

You could do more or less the same thing with an iframe or even a div or a
layer.

Well thats how I looked at it anyway.

And yes, the browser will definately cache the image. But it defines between
different querystrings so if one image was fetched with one query string the
cache will store it sepeartely to one with the same file name but different
querystring - that quesrystring being the co-ords.

I think, but am not sure that, that you can get away from cached images if you
use this

<img src='' id='im>
<script>
var img = new Image();
img.src = "/server/dynamicimages.ashx??x1=p1&x2=p2&y1=p3&y2=p4";
document.images.im.src = img.src
</script>

I thing the img.src tag doesn't look in the cache .... but don't quote me.

So .... watch out MapPoint, you have competition.

Now all we have to do is get some huge database of every postal address and
every postal address system in the world, comprehensive global satellite images
of the surface of the planet taken at different altitudes, and again at night,
and in the winter,summer, autumn, spring, and climate data, stars, and ......

.... and then create our own binary format database running on it's own
optimized server that gives us super fast access to this vast amount of data so
we can generate the images we wish to display ... and all so your local
superstore can supply a map to give some business man directions to their store,
through a monitor installed in a highly noticable portion of his BMW's dash
board whilst telling him to turn left or right through his mobile phone .... and
with all this going on and he's expected to cope ? Bear in mind he thinks he's
James Dean and he's got 600 horses under his hoof and a crumple zone that would
frighten a Boeing, I give him and/or his immediate vicinity about a minite of
existence left.

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Causing timed form Post Or get search suggestion and latest updates.


Tagged: