Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight Canvas Sizing within a ScrollViewer
    primarykey
    data
    text
    <p>I am making a Silverlight 4 website with C#. In one of the pages, I want to have two panels beside each other. On the left is a map control and on the right is an image. That is easy enough, but I also want to be able to click on the image and leave PushPin like objects (like the map) so I put the image in a canvas and just draw circles. The problem is that image can be fairly large and I need to be able to scroll the image. I tried several different ways of achieving this, but so far no luck.</p> <p>The answers to the following post seemed to be like the way to go, but there must be updates to Silverlight that broke it. <a href="https://stackoverflow.com/questions/855334/wpf-how-to-make-canvas-auto-resize/863108#863108">WPF: How to make canvas auto-resize?</a></p> <p>A similar solution suggested making the Canvas from scratch, but I ran into the same problem. <a href="http://themechanicalbride.blogspot.com/2008/11/auto-sizing-canvas-for-silverlight-and.html" rel="nofollow noreferrer">http://themechanicalbride.blogspot.com/2008/11/auto-sizing-canvas-for-silverlight-and.html</a></p> <p>Most of my attempts end in displaying as much of the image as possible on the screen, but no scroll bars (still greyed out) or the page just goes white when the image is loaded.</p> <p>I can provide code if needed, just let me know. Any help will be appreciated.</p> <p>The following is how I am currently selecting the image to load:</p> <pre><code> OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "Image Files (*.png, *.jpg)|*.jpg;*.png"; if(dialog.ShowDialog() == true) { BitmapImage bitmap = new BitmapImage(); FileStream stream = dialog.File.OpenRead(); bitmap.SetSource(stream); TheImage.Source = bitmap; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload