I have created a 3D structure(basically an image) dynamically using kit3D.However,I wanted to zoom only a small segment of the whole structure.My entire image is loaded altogather at a time,so I am not considering using deep zoom.
Is there anyway where I can zoom only a part of a dynamically generated image in silverlight??
Thank you,
Ramya
You can use a Scale RenderTransform to increase the size of the image, then use a clip to only show one part of it, thus giving the effect of zoom.
Alternatively you can use a ViewBox from the Silverlight toolkit
I'd use a MultiScaleTileSource for that. It's a callback based system - it requests Deep Zoom tiles from a function you implement when the user zooms or pans.
Here's some sample code, and here's a full working example that pulls map tiles dynamically from Virtual Earth.
This example may be helpful.
there is an example of use silverlight 3 and Virtual Earth on http://www.silverenlightenment.com/
Related
I need to display many markers on a WPF image. The markers can be lines, circles, squares, etc. and there can be several hundreds of them.
Both the image source and the markers data are updated every few seconds. The markers are associated with specific pixels on the image and their size should be absolute in relation to the screen (i.e. when I move the image the markers should move along with it, but if i zoom in, they should take the same space of the screen as before).
Currently, I've implemented this using the AdornerLayer. This solution has several problems but the most significant one is that the UI doesn't fare well under the load even for 120 such markers.
I wanted to ask what would be the best way to go about implementing this? I thought of two solutions:
Inherit from Canvas and make sure it is invalidated not for every
added marker but for a range of markers at once
Create a control that holds an image and change its OnDraw to draw all the markers
I would appreciate some pointers from someone with experience with a similar problem.
Your use case looks quite specialized, so a specialized solution seems in order. I'd try a variant of your second option — extend Image, overriding its OnRender method.
The div that my openlayers map is in is about 300px wide, and I want to zoom down to level 0 (one single 256x256 tile), but I can't in OpenLayers. But I can with Google maps.
I've looked for a setting, but I can't find it.
All I want to do is see the whole world at the same time. I can in Google maps. Google lets you see about 150% of the world, but in openlayers in seems to be limited to 100%, which means if I want to see a map of the whole world (a reasonable request) I have to resize my window down to the exact pixel. That's a bit ridiculous. Is this really so hard to do?
Thanks.
Openlayers 2.12 had a change which prevented the map from zooming out to see two worlds if the base layer is set to wrapDateLine
https://github.com/openlayers/openlayers/blob/master/notes/2.12.md#changes-when-base-layer-configured-with-wrapdateline-true
The smallest tile what OpenStreetMap provides is 256x256 (http://c.tile.openstreetmap.org/0/0/0.png), so you cant get a smaller view of the world without resizing.
I have an ximage which I want to zoom in on, and display. I'm currently taking the naive approach:
allocate bigger image
use nearest-neighbor interpolation to fill it in.
put the whole image on a pixmap.
Which works, but slowly, and crawls once I approach bigger zoom levels, like 800%. The gimp, however, can zoom in to 3200% and still feel snappy. What's the approach taken here? Should I only fill one screen at a time? But then what about scrolling: wouldn't performing interpolation, and an XPutImage, and an XCopyArea on each expose kill performance?
I'm not expert in Xlib, but in my opinion a good approach would be to draw only the zoomed part, instead of computing the interpolation of the entire image.
For scrolling, if you are looking for performances, you may copy the part of the old zoom which is still visible in the new position, and compute the interpolation of the "discovered" pixels. For example, when scrolling down, you may copy the bottom of the previous image and paste it higher, and then compute/draw the new visible stuff at the bottom.
Most modern X11 applications don't use Xlib directly much, if at all. My guess would be that Gimp is rendering the zoomed image into a buffer itself and drawing that to the window, rather than working with the image in an XImage.
There is a multiscale image with deepzoom image as a source. Now I need to allow users to draw poligons and lines on top of the multiscalimage in such a way that the shapes will follow drag and zoom to scale accordingly.
I tried to add a canvas in addition to the multiscaleimage but can't figure out how to make them stick to each other on zoom or drags.
If you have done any user shape drawing on top of deepzoom image, please share your methods.
Thanks,
Val
Have you checked the Silverlight 4 Puzzle demo?
http://johnpapa.net/silverlight/silverlight-4-html-puzzle-how-does-it-work/
You may be able to get some "inspiration" by inspecting this app.
Follow the link to download the source:
http://www.silverlight.net/community/samples/silverlight-4/html-puzzle/
I've done this before. Not sure if this is the preferred/optimal way, but you can add layers to your root deepzoom layer. (sorry, i forget the proper terminology).
In my case i had 4 sub layers, some of which were used to render lines and shapes, others were used to render entire maps that were loaded from a URI.
Is it possible to resize a silverlight/flash video player on the fly? I would like to create a video where I can drag the bottom left corner to resize the player (maintaining aspect ratio) or at least eliminate the possibility of doing so I could move on to other methods.
Thanks in advance...
EDIT: // forgot to mention
Sorry forgot to mention, this would also mean that the actual video itself resizing right?
Silverlight: Absolutely. Just set the the Stretch property to Uniform and then alter either the Width or Height as you resize.
Flash: Yes, you can alter the size of a flash object through JavaScript. Using a YUI, jQuery, or a Mootools JavaScript library, this should not be too difficult to prototype.
Here is a posts which explains how to resize flash from within your flash code.
Proportional resizing - here is an example of that as well using jQuery.
I'm not sure if the same is true for Silverlight browser objects, although I'd be surprised if you couldn't do the same.
This is a CSS solution for resizing videos on the fly.
The video can even resize itself according to the user settings if it is styled using EMs. This demo shows how a video resize itself according to the width of the user agent.
Here is an example of the silverlight scaling. This photo retouching and restoration site has a couple of silverlight controls that scale with browser resizing. There is quite a nice photo gallery that shows the photos before and after the retouch.
JWPlayer
As of version 5.3 they added a resize() method to the javascript API which allows you to resize a player - and all the control bar etc. will resize correctly too.
http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12540/javascript-api-reference
resize(width, height) Resizes the
player to the specified dimensions.
width:Number: the new overall width of
the player.
height:Number: the new
overall height of the player. Note: If
a controlbar or playlist is displayed
next to the video, the actual video is
of course smaller than the overall
player.