silverlight - Deep Zoom Aspect Ratio Returning Wrong Value -
my multiscaleimage returning aspect ratio of 1, when image 2000x1500 png. what's more odd, xml metadata shows 1.33 in aspect ratio tag, has height , width of 1.
what heck missing here?
thanks help!
metadata:
<metadata version="1"> <aspectratio>1.33333333333333</aspectratio> <image> <filename>c:\documents , settings\asmith\desktop\temp\dzcomposer\testing1\source images\2000x1500 sample image.png</filename> <x>0</x> <y>0</y> <width>1</width> <height>1</height> <zorder>1</zorder> <tag /> </image> </metadata>
the dzc_output.xml agrees also:
<collection maxlevel="8" tilesize="256" format="jpg" nextitemid="1" serverformat="default" xmlns="http://schemas.microsoft.com/deepzoom/2009"> <items> <i id="0" n="0" source="dzc_output_images/2000x1500%20sample%20image.xml"> <size width="2000" height="1500" /> <viewport width="1" x="-0" y="-0" /> </i> </items> </collection>
msi declaration:
<multiscaleimage x:name="msi" grid.column="1" grid.row="1" width="720" height="540" mousemove="msi_mousemove" mouseleftbuttonup="msi_mouseleftbuttonup"> </multiscaleimage>
property outputs: (based on msi's mousemove)
width: 720
height: 540
aspectratio: 1
width / aspect ratio: 720
logical x: 0.55555555556
logical y: 0.37361111111
logical x * width: 400
logical y * width: 269
raw x: 400
raw y: 269
viewport origin: 0,0
viewport width: 1
codebehind populates property outputs:
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(); }
dzc_output.xml's width , height original image size in pixels, while aspect ratio in metadata width , height of multiscaleimage whole. width , height of image in metadata logical multiscaleimage's size.
Comments
Post a Comment