LEADTOOLS Support
General
General Questions
Betreft: Re: Leadtools Silverlight Viewer - Zoom
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, January 4, 2010 2:17:20 AM(UTC)
Groups: Registered
Posts: 7
Hello,
I'm trying to create a specific toolbar for the Silverlight Viewer, but I already have some problems with defining the Zoom buttons.
When you select "Normal" as SizeMode, it's possible to adapt the ScaleFactor to do the zooming.
Unfortunately, I open my images with SizeMode "Fit". It's not possible to change the ScaleFactor then. So I created my code that it should reset the SizeMode to "Normal" when I want to change the ScaleFactor, but I need to set the initial ScaleFactor first! (Otherwise, my image resets to a 100% view, and afterwards zooms in)
I want my image to Zoom In starting from the "Fit"-SizeMode, so it's a bit logic for the user that uses this.
Some code:
Private Sub LoadImageLeadtools(ByVal sFile As String)
oLeadViewer = New Leadtools.Silverlight3.Controls.ImageViewer
...
oLeadViewer.SizeMode = Leadtools.Silverlight3.Controls.PaintSizeMode.Fit
If oLeadViewer.Width > 0 Then
MessageBox.Show(oLeadViewer.Height & " - " & oLeadViewer.Width & " : " & oLeadViewer.ScaleFactor & " o " & (oLeadViewer.Height / oLeadViewer.Width))
End If
...
End Sub
Private Sub ZoomInLeadtools()
oLeadViewer.SizeMode = Leadtools.Silverlight3.Controls.PaintSizeMode.Normal
oLeadViewer.ScaleFactor = oLeadViewer.ScaleFactor + 0.1
End Sub
Private Sub ZoomOutLeadtools()
oLeadViewer.SizeMode = Leadtools.Silverlight3.Controls.PaintSizeMode.Normal
oLeadViewer.ScaleFactor = oLeadViewer.ScaleFactor - 0.1
End Sub
Private Sub ZoomLeadtools(ByVal iFactor As Double)
oLeadViewer.SizeMode = Leadtools.Silverlight3.Controls.PaintSizeMode.Normal
oLeadViewer.ScaleFactor = iFactor
End Sub
==> Setting the SizeMode to "Normal" automatically Zooms my image extremely.
Does anybody has some ideas on how to do this?
Can I "calculate" the ScaleFactor that is used for SizeMode.Fit?
Sincerely,
Tim Derdelinckx
#2
Posted
:
Tuesday, January 5, 2010 5:45:39 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Tim,
Please send an email to
support@leadtools.com and mention this post in the email. I want to check this issue further.
#3
Posted
:
Wednesday, January 6, 2010 5:57:57 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
We will continue our discussion regarding this issue on ticket 2010010610000137 that you sent to
support@leadtools.com
#4
Posted
:
Wednesday, January 13, 2010 11:04:10 AM(UTC)
Groups: Registered
Posts: 7
Thanks to the splendid support-department of Leadtools, we found a solution, and my ZoomIn and ZoomOut functions are as follows: (oLeadViewer is the name of the Leadtools Silverlight control):
Private Sub ZoomInLeadtools()
If oLeadViewer.SizeMode = Leadtools.Silverlight3.Controls.PaintSizeMode.Fit Then
Dim x As Double
oLeadViewer.UpdateLayout()
x = oLeadViewer.HorizontalScaleFactor
oLeadViewer.SizeMode = Leadtools.Silverlight3.Controls.PaintSizeMode.Normal
oLeadViewer.ScaleFactor = x
End If
If oLeadViewer.ScaleFactor 0.1 Then
oLeadViewer.ScaleFactor = oLeadViewer.ScaleFactor - 0.05
End If
End Sub
Thank you very much Adnan,
Greetz,
Tim
LEADTOOLS Support
General
General Questions
Betreft: Re: Leadtools Silverlight Viewer - Zoom
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.