Expression > 포럼 홈 > Deep Zoom Composer > How to limit how far one can zoom in & out
질문하기질문하기
 

답변됨How to limit how far one can zoom in & out

  • 2009년 6월 15일 월요일 오전 5:55Radeldudel 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음

    Is there a way to limit how far the viewer can zoom into or out of the picture?

    I would like to stop the zooming in when the viewer reaches the pixel level, and the zooming out to the size of the picture.

    To be able to zoom until the picture content either looks blurry or is small on the screen is not very appealing to me.

    Is there a way to achieve this, to limit the zoom range?

    kind regards,
    Sam

답변

  • 2009년 6월 16일 화요일 오전 4:02Baruni 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨코드 있음
    You can change the code in the page.xaml.cs file. I'm not sure if there are other ways of setting it but this is how I set it:

    In the example below, the zoom level is set between 0.45 and 128


            private void Zoom(double newzoom, Point p)
            {
                if (newzoom < 0.45)
                {
                    newzoom = 0.45;
                }
                if (newzoom > 128)
                {
                    newzoom = 128;
                }
    
                msi.ZoomAboutLogicalPoint(newzoom / zoom, p.X, p.Y);
                zoom = newzoom;
            }
    
    • 답변으로 표시됨Radeldudel 2009년 6월 16일 화요일 오전 6:45
    •  

모든 응답

  • 2009년 6월 16일 화요일 오전 4:02Baruni 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨코드 있음
    You can change the code in the page.xaml.cs file. I'm not sure if there are other ways of setting it but this is how I set it:

    In the example below, the zoom level is set between 0.45 and 128


            private void Zoom(double newzoom, Point p)
            {
                if (newzoom < 0.45)
                {
                    newzoom = 0.45;
                }
                if (newzoom > 128)
                {
                    newzoom = 128;
                }
    
                msi.ZoomAboutLogicalPoint(newzoom / zoom, p.X, p.Y);
                zoom = newzoom;
            }
    
    • 답변으로 표시됨Radeldudel 2009년 6월 16일 화요일 오전 6:45
    •