This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Another Viewer Question!

I need to know is there is a way to zoom in and zoom out with using the built in control. What I need to be able to do is set a button to zoom in and a button to zoom out. When that button is clicked it automatically zooms in a certain amount and visa versa. Is this possible? I do not want the user to have to click on a button then click the document to zoom. Then click back on the pointer button.

Thanks in advance

Chris
Hello Chris,

Chris Herrington (9/7/2005)
I need to know is there is a way to zoom in and zoom out with using the built in control. What I need to be able to do is set a button to zoom in and a button to zoom out. When that button is clicked it automatically zooms in a certain amount and visa versa. Is this possible? I do not want the user to have to click on a button then click the document to zoom. Then click back on the pointer button.


Yes, it is possible. Check the following article:

Enchancing Interactivity with Client-Side Scripting

In short you can use following JavaScript code to zoom in and zoom out 1.5 times:

var bitmapViewer1=document.getElementById("<%=BitmapViewer1.ClientID%>");    
bitmapViewer1.setZoom(bitmapViewer1.getZoom()*1.5);


var bitmapViewer1=document.getElementById("<%=BitmapViewer1.ClientID%>");     
bitmapViewer1.setZoom(bitmapViewer1.getZoom()*0.66);