Note that there are some explanatory texts on larger screens.

plurals
  1. PODeep Zoom Aspect Ratio Returning Wrong Value
    text
    copied!<p>My MultiScaleImage is returning an aspect ratio of 1, when the image is a 2000x1500 png. What's even more odd, is that the xml metadata shows 1.33 in the aspect ratio tag, but then has a height and width of 1. </p> <p>What the heck am I missing here? </p> <p>Thanks for any help!</p> <p><strong>MetaData:</strong></p> <pre><code>&lt;Metadata version="1"&gt; &lt;AspectRatio&gt;1.33333333333333&lt;/AspectRatio&gt; &lt;Image&gt; &lt;FileName&gt;C:\Documents and Settings\asmith\Desktop\Temp\DZComposer\Testing1\Source Images\2000x1500 sample image.png&lt;/FileName&gt; &lt;x&gt;0&lt;/x&gt; &lt;y&gt;0&lt;/y&gt; &lt;Width&gt;1&lt;/Width&gt; &lt;Height&gt;1&lt;/Height&gt; &lt;ZOrder&gt;1&lt;/ZOrder&gt; &lt;Tag /&gt; &lt;/Image&gt; &lt;/Metadata&gt; </code></pre> <p><strong>The dzc_output.xml agrees with this also:</strong></p> <pre><code>&lt;Collection MaxLevel="8" TileSize="256" Format="jpg" NextItemId="1" ServerFormat="Default" xmlns="http://schemas.microsoft.com/deepzoom/2009"&gt; &lt;Items&gt; &lt;I Id="0" N="0" Source="dzc_output_images/2000x1500%20sample%20image.xml"&gt; &lt;Size Width="2000" Height="1500" /&gt; &lt;Viewport Width="1" X="-0" Y="-0" /&gt; &lt;/I&gt; &lt;/Items&gt; &lt;/Collection&gt; </code></pre> <p><strong>MSI Declaration:</strong></p> <pre><code>&lt;MultiScaleImage x:Name="msi" Grid.Column="1" Grid.Row="1" Width="720" Height="540" MouseMove="msi_MouseMove" MouseLeftButtonUp="msi_MouseLeftButtonUp"&gt; &lt;/MultiScaleImage&gt; </code></pre> <p><strong>Property outputs:</strong> <em>(based on the msi's mousemove)</em></p> <p>Width: 720</p> <p>Height: 540</p> <p>AspectRatio: <strong>1</strong></p> <p>Width / Aspect Ratio: 720</p> <p>Logical X: 0.55555555556</p> <p>Logical Y: 0.37361111111</p> <p>Logical X * Width: 400</p> <p>Logical Y * Width: 269</p> <p>Raw X: 400</p> <p>Raw Y: 269</p> <p>Viewport Origin: 0,0</p> <p>Viewport Width: 1</p> <p><strong>Codebehind that populates property outputs:</strong></p> <pre><code>private void msi_MouseMove(object sender, MouseEventArgs e) { txtWidth.Text = msi.Width.ToString(); txtHeight.Text = msi.Height.ToString(); txtAspectRatio.Text = msi.AspectRatio.ToString(); txtWidthDivAR.Text = (msi.Width / msi.AspectRatio).ToString(); Point pLogical = msi.ElementToLogicalPoint(e.GetPosition(msi)); txtMsiX.Text = pLogical.X.ToString(); txtMsiY.Text = pLogical.Y.ToString(); txtLogicYxW.Text = (pLogical.Y * msi.Width).ToString(); txtLogicXxW.Text = (pLogical.X * msi.Width).ToString(); Point pRaw = e.GetPosition(msi); txtRawX.Text = pRaw.X.ToString(); txtRawY.Text = pRaw.Y.ToString(); txtVPO.Text = msi.ViewportOrigin.ToString(); txtVPW.Text = msi.ViewportWidth.ToString(); } </code></pre>
 

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