Recent activity
Subscribe to this feed
Aseem Kishore replied on February 08, 2010 20:20 to the question "How can I create an interactive overlay on Seadragon Ajax?" in Microsoft Live Labs:
Aseem Kishore replied on February 08, 2010 20:19 to the question "Question about Seadragon Ajax" in Microsoft Live Labs:
Thanks for the praise!
When the user zooms in, only then will Seadragon fetch the required tiles from the image folder on the server. It won't fetch all of them at page load time. The whole idea of Seadragon is that we fetch only what we need, when we need it.
So we fetch as little as possible at page load time. We fetch the rest when the user zooms in.
Deep Zoom Composer isn't too customizable, but we do make available the underlying API it uses, in the form of a .NET class library: http://seadragon.com/developer/creati...
Hope this helps!
Aseem Kishore replied on February 05, 2010 18:58 to the question "Not seeing key events with Seadragon Ajax" in Microsoft Live Labs:
Glad to hear!
By the way, quick note: my code above only tracks a single key being pressed. If you want to track multiple keys, i.e. key combos, you would want to use an array of key codes instead of a single key code.
Also by the way, some brief testing on my end showed that the keyup event doesn't fire if you let go after clicking. But maybe that was only because the click event handler raised an alert.
Aseem Kishore replied on February 05, 2010 18:55 to the question "checkerboard scaling artifacts" in Microsoft Live Labs:
Ah, so you're saying that even when the image is a "perfect" size (e.g. exactly half resolution, or quarter resolution), Seadragon Ajax is still rendering and scaling the next level, instead of rendering only the exact level it's at?
That sounds like one of those bugs where somewhere in the code is a >= sign instead of just >. =P If you do decide to dive into the code yourself, the file to look at will be Seadragon.Drawer.js. Somewhere in the update() routine, it'll be calculating the levels to iterate over. I would guess the fix would go in there.
If I get some time I'll try to investigate this myself briefly. And no problem, we're glad to help!
Aseem Kishore replied on February 05, 2010 18:50 to the question "Question about Seadragon Ajax" in Microsoft Live Labs:
Glad to hear that it's working like a charm!
By "required images", I assume you're referring to the image tiles? If not, let me know.
That code won't load all of the tiles right away, but it will load as many of the tiles as necessary to view the image at its current size. When the user zooms in, it will load new tiles as needed.
Does that answer your question?
Aseem Kishore replied on February 05, 2010 02:34 to the question "using the Seadragon Ajax source under linux" in Microsoft Live Labs:
Hey Dan,
This is not a naive question at all -- we're here to help!
I have very little experience working with or on the Microsoft Ajax Library version (which was formerly the Ajax Control Toolkit version, but they're both roughly the same). That version was actually ported over by the ASP.NET team; we gave them the source code to our original standalone version (which we serve up from seadragon.com as seadragon-min.js), and they made significant changes to the source to integrate it nicely with the rest of the Microsoft Ajax Library.
Internally, for our standalone version, we do have exactly a "load.js" type of file to aid development without a full dev environment, but you're right, that file didn't get ported over to the Microsoft Ajax Library version. They instead have a build process which concatenates the files.
I'm happy to share the source to our "load.js" file, but note that part of the changes they made in their port was to the structure and organization of the various source files. So I've tried my best to match up the filenames and whatnot, but please excuse any mistakes.
By the way, I'm assuming you're working with the source files and not the built ones. The source files end in ".pre.js" while the built files end in either just ".js" or ".debug.js". If you're working with the built files, it should work to just replace ".pre.js" everywhere below with ".debug.js" instead.
// seadragon-dev.js
// Loads the various Seadragon Ajax source files for ease of development.
// This is a port for the Microsoft Ajax Library version of the source files.
(function() {
var PATH = "Client/MicrosoftAjax.Extended/Seadragon/"; // the path to the scripts, relative to HTML page
var SCRIPTS = [ // the script filenames, in dependency order
"Seadragon.Config.pre.js",
"Seadragon.Strings.pre.js",
"Seadragon.Profiler.pre.js",
"Seadragon.Point.pre.js",
"Seadragon.Rect.pre.js",
"Seadragon.Spring.pre.js",
"Seadragon.Utils.pre.js",
"Seadragon.MouseTracker.pre.js",
"Seadragon.ImageLoader.pre.js",
"Seadragon.Buttons.pre.js",
"Seadragon.TileSource.pre.js",
"Seadragon.DisplayRect.pre.js",
"Seadragon.DeepZoom.pre.js",
"Seadragon.Viewport.pre.js",
"Seadragon.Drawer.pre.js",
"Seadragon.pre.js"
];
var html = [];
for (var i = 0; i < SCRIPTS.length; i++) {
html.push('<script type="text/javascript" src="');
html.push(PATH);
html.push(SCRIPTS[i]);
html.push('"></script>\n');
}
document.write(html.join(''));
})();
Note that the code will still have a dependency on the Microsoft Ajax Library, so you'll have to include that code in your page as well. But I think this is really easy to do since the library is hosted on a CDN:
<script src="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjax.js"></script>
So try that and let me know if you encounter any problems. I hope this helps!
Aseem Kishore replied on February 05, 2010 01:53 to the idea "Gigapixel Project Needs This" in Microsoft Live Labs:
Aseem Kishore replied on February 05, 2010 01:50 to the question "How to add the functionality that the 'Esc' key closes fullscreen in Seadragon viewer" in Microsoft Live Labs:
Thanks to David (houseofyin) via his related post, Not seeing key events, I found that the code I gave above doesn't work across browsers either, because the keyboard events don't fire on the viewer element directly. So instead, listen to the page.
I've updated the code in my original reply above, but here's the modified code directly:
Seadragon.Utils.addEvent(window, "keydown", onViewerKeyPress);
function onViewerKeyPress(event) {
event = Seadragon.Utils.getEvent(event);
if (event.keyCode === 27) { // 27 means esc key
viewer.setFullPage(false);
}
}
Aseem Kishore set one of Aseem Kishore's replies as an official response to "Not seeing key events with Seadragon Ajax" in Microsoft Live Labs
Aseem Kishore replied on February 05, 2010 01:41 to the question "Not seeing key events with Seadragon Ajax" in Microsoft Live Labs:
Hey David,
This is indeed interesting -- I get the same result as you and haven't been able to figure it out. I've searched for answers but came across none.
Well, to quickly clarify, it's expected that the keyCode property is always empty on the click event; part of the spec is that it only applies for keyboard events. Mozilla's DOM reference confirms this.
But, I don't know why your key handlers are never fired. I'm just going to guess that it has to do with focus, i.e. that the viewer never gets keyboard focus (since it's not a textbox/hyperlink/etc.) and so any keypress events -- even after you click on the viewer -- never fire on the viewer element directly. I even tried removing the alerts, thinking that maybe the alerts were stealing focus after clicking, but that didn't help.
Nonetheless, I have a simple workaround that I've tested and works: for the key events, listen to the entire page instead of the viewer element specifically. Then make a simple state machine: remember the key that's last pressed and when it's released.
Here's your code modified to work, with the changes bolded:
var currentKey = 0;
function loadImage()
{
viewer = new Seadragon.Viewer("container");
viewer.openDzi("myimage.xml");
// I've removed the keypress event due to browser incompatibilities;
// More on that below...
Seadragon.Utils.addEvent(window, "keydown", monitorKeyDown);
Seadragon.Utils.addEvent(window, "keyup", monitorKeyUp);
Seadragon.Utils.addEvent(viewer.elmt, "click", mouseClick);
}
function monitorKeyDown(event)
{
event = Seadragon.Utils.getEvent(event);
currentKey = event.keyCode;
}
function monitorKeyUp(event)
{
event = Seadragon.Utils.getEvent(event);
currentKey = 0;
}
function mouseClick(event) {
event = Seadragon.Utils.getEvent(event);
alert("key: " + currentKey + "\n" +
"shift? " + event.shiftKey + "\n" +
"alt? " + event.altKey + "\n" +
"ctrl? " + event.ctrlKey);
}
By the way, I would strongly advise reading up on the state of keyboard events across browsers; it's a freaking mess. The best and most comprehensive article I've found on it is PPK's Detecting Keystrokes guide.
(That's also why I removed the keypress event from your code, because the keyCode property means something different during keypress than keydown/up in IE and Opera. If you stick to only keydown/up and only read the keyCode property, though, that's pretty consistent across browsers.)
I hope this helps!
Aseem Kishore replied on February 05, 2010 00:39 to the question "Disabling zoom in/out buttons when maximum/minimum level reached?" in Microsoft Live Labs:
Hey Anthony,
Sorry for the delay in responding! It's certainly possible, but we didn't have the time or resources to pursue it before we shipped, and it hasn't come up as high priority since.
It's not exactly trivial to implement this yourself on top of the library (for example, extending the button logic to include a "disabled" state where no inputs are accepted), but if you're really interested, let us know and we can try to help. Otherwise, maybe this will be in a future version of the library. =)
Cheers!
Aseem Kishore set one of Aseem Kishore's replies as an official response to "can you create RSS feed of deepzoom images ?" in Microsoft Live Labs
Aseem Kishore replied on February 04, 2010 23:31 to the question "can you create RSS feed of deepzoom images ?" in Microsoft Live Labs:
Hey Dieter,
Sorry for the delay, but the answer is yes, you can! Each <item> in the feed should include:
- An <enclosure> referencing the .dzc/.dzi/.xml of the image or collection. The MIME type of this enclosure must be "text/xml".
- An optional <enclosure> referencing a thumbnail for this image or collection. The MIME type of this enclosure must be "image/jpeg" or "image/png". This thumbnail should be at least 64x64 and is ideally no bigger than 128x128.
- A <guid> with some unique value. This can be an actual GUID (e.g. generated through guidgenerator.com), or it can simply be the URL of the image or collection.
Here is an example feed:
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>My Seadragon RSS</title>
<link>http://example.com/</link>
<description>Some cool Seadragon content.</description>
<language>en-us</language>
<item>
<category>Photos</category>
<guid>5178b7d9-852b-4373-86db-fcd242aaebda</guid>
<title>My Picture Set</title>
<author>johnsmith@example.com (John Smith)</author>
<enclosure type="text/xml" length="0"
url="http://example.com/mycollection.xml" />
<enclosure type="image/jpeg" length="0"
url="http://example.com/mycollection.jpg" />
</item>
</channel>
</rss>
Hope this helps, and let us know if you try this!- An <enclosure> referencing the .dzc/.dzi/.xml of the image or collection. The MIME type of this enclosure must be "text/xml".
Aseem Kishore replied on February 04, 2010 22:48 to the problem "Firefox drawImage uncaught exception" in Microsoft Live Labs:
Hi alberto,
I'm very sorry for the delay in responding here. I checked out the page in my Firefox (also 3.5, but on Windows) and I too get the same error.
Unfortunately, I'm completely unable to debug it, as Firebug doesn't seem to detect the exception until it bubbles all the way to the top. And even then, no stack trace is ever shown.
I've spent a bit of time on this but I don't really have the resources to dedicate any more time at the moment. This bug doesn't happen in Chrome or Safari for me, and in theory it should never be happening here (I've never seen this before), so maybe it's a bug within Firefox. One thing you could do is file a bug at Mozilla's Bugzilla.
Again, apologies for the delay and not being able to help further, but please let us know what you find. Good luck!
Aseem Kishore set one of Aseem Kishore's replies as an official response to "Seadragon Ajax Overlays & HREF" in Microsoft Live Labs
Aseem Kishore replied on February 04, 2010 20:32 to the question "Seadragon Ajax Overlays & HREF" in Microsoft Live Labs:
Michael,
I'm sorry that it's taken me so long to reply. I hope this is still relevant and timely for you.
The link doesn't work because the default action of clicking on the <a> element (navigating to the link) is canceled by the Seadragon.MouseTracker instance for the Seadragon canvas. This is the default behavior of MouseTracker whenever a clickHandler is registered. In this case, a clickHandler is registered on the canvas to zoom in when the user clicks.
Off the top of my head, I can't remember why that behavior (canceling the default click action if a click handler is registered) was necessary. But I do remember a simple workaround: to stop the event from propagating up to the MouseTracker's element. We do this in our about screen with two lines of code; here they are, adapted to your overlay:
// make sure that clicking the link works; prevent the MouseTracker
// from canceling the click event by stopping the event's propagation
// up to the canvas element that the MouseTracker is listening to.
// we're also stopping "mouseup" events due to a bug in MouseTracker.
Seadragon.Utils.addEvent(harry, "mouseup", Seadragon.Utils.stopEvent);
Seadragon.Utils.addEvent(harry, "click", Seadragon.Utils.stopEvent);
Sorry that this caused you trouble, but hope this helps!
Aseem Kishore set one of Aseem Kishore's replies as an official response to "checkerboard scaling artifacts" in Microsoft Live Labs
Aseem Kishore replied on February 04, 2010 20:15 to the question "checkerboard scaling artifacts" in Microsoft Live Labs:
Hey Dan,
Indeed, astute observation! Seadragon Ajax does choose to always scale down higher-res tiles rather than scale up lower-res tiles.
In general, this leads to better and sharper output, but in cases like yours where the imagery is different per level, it can indeed lead to undesirable results. Since the vast majority of imagery out there and used by Seadragon is the same per level (e.g. regular photographs), we went with our behavior.
We don't unfortunately have a knob or config to tweak that behavior, but that's a reasonable request. I can honestly say we just don't have the resources to do this and ship it anytime soon (I personally am stretched thin already), but hopefully in a future version of Seadragon Ajax we can include this functionality.
If you want to ensure that the initial home zoom is a "nice" zoom level, as you put it, you can definitely do so. Take a look at this thread where Dustin shares equations for translating between "zoom level" and "scale". You could try extending that code to say "given this default home zoom level, give me the zoom level that will render the image at the nearest 'nice' scale", where "nice" means an exact log_2 value, e.g. 1, 0.5, 0.25, 0.125, etc.
I'm sorry that this is a problem for you, and I hope you're able to find a suitable solution or workaround. Do share with us any progress you make, and thanks for understanding!
Aseem Kishore replied on February 04, 2010 19:24 to the question "Question about Seadragon Ajax" in Microsoft Live Labs:
Aseem Kishore set one of Aseem Kishore's replies as an official response to "Seadragon-ajax not working in drupal" in Microsoft Live Labs
| next » « previous |
Loading Profile...






