0

ブラウザー外モードで、Silverlight アプリケーション全体のズーム機能 (CTRL + マウスホイール / ブラウザーでのズーム) を使用することは可能ですか?

4

2 に答える 2

0

わかりました..「ズームイン」および「ズームアウト」ボタンクリック用にこのコードを実装しました。

In Button Click Event :

commonwidth = commonwidth + (commonwidth * zoomPercent / 100) //For Zoom Out
commonwidth = commonwidth + (commonwidth * zoomPercent / 100) //For Zoom In

次に、このメソッドを呼び出します:

            Private Sub ChangZoom()

            If Not fresult Is Nothing Then

                If fresult.Count() > 0 Then

                    Dim mainFrame As StackPanel

                    mainFrame = fresult(_currentPage)

                    Dim docBorder As Border

                    docBorder = mainFrame.Children(1)

                    Dim docImage As FrameworkElement

                    docImage = docBorder.Child

                    If Not docImage Is Nothing Then

                        Dim actualWidth As Double
                        Dim actualHeight As Double

                        actualWidth = commonwidth 'Me.ActualWidth - 30
                        actualHeight = Me.ActualHeight

                        Dim newHeight As Double

                        newHeight = actualWidth * docImage.Height / docImage.Width

                        docImage.Width = actualWidth
                        docImage.Height = newHeight

                        RenderResutlFrame(_currentPage)

                    End If

                End If

            End If

        End Sub

        Public Property ImageUrl As String Implements IDocumentViewer.ImageUrl
            Get
                Return _imageUrl
            End Get
            Set(ByVal value As String)
                _imageUrl = value

                'Me.Dispatcher.BeginInvoke(AddressOf OnInitialized)

            End Set
        End Property
于 2012-12-26T09:22:42.250 に答える
0

Application_Startupで以下を使用できます。

RootVisual = new WebBrowser() {Source = new Uri(Current.Host.Source, "../")};
于 2012-07-31T13:55:26.383 に答える