This is a migrated thread and some comments may be shown as answers.

PanAndZoomImage, RadSlideView and RotateTransform

1 Answer 61 Views
PanAndZoomImage
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
QMatteoQ
Top achievements
Rank 1
QMatteoQ asked on 09 Jul 2013, 03:37 PM
Hi, I have a RadSlideView control in a Windows Phone 8 application, which uses, as ItemTemplate, a PanAndZoomImage control.
I'm using this combination to have a complete image gallery: the user can swipe between the different pictures and have zooming support on each of it.
Now I need to support rotation, since I'm retrieving the Exif information of the picture to determine the current orientation. Here is how my RadSlideView looks like:

<telerikPrimitives:RadSlideView x:Name="slideView"
                                       ItemsSource="{Binding Items}"
                                       SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                       SelectionChanged="SlideView_OnSelectionChanged"
                                       IsShowOverlayContentOnTapEnabled="False"
                                       ItemRealizationMode="ViewportItem"
                                       IsLoopingEnabled="False" >
           <telerikPrimitives:RadSlideView.ItemTemplate>
               <DataTemplate>
                   <Grid>
                       <telerikPrimitivesSlideView:PanAndZoomImage Margin="6,0,6,0" ZoomMode="Free" RenderTransformOrigin="0.5, 0.5" >
               
                           <telerikPrimitivesSlideView:PanAndZoomImage.Source>
                               <BitmapImage attachedProperties:FullImageDowloader.Source="{Binding Path=ImageDisplayedPath}" />
                           </telerikPrimitivesSlideView:PanAndZoomImage.Source>
 
                           <telerikPrimitivesSlideView:PanAndZoomImage.RenderTransform>
                               <RotateTransform Angle="{Binding Path=Orientation, Converter={StaticResource OrientationToAngleConverter}}" />
                           </telerikPrimitivesSlideView:PanAndZoomImage.RenderTransform>
 
                       </telerikPrimitivesSlideView:PanAndZoomImage>
                   </Grid>
               </DataTemplate>
           </telerikPrimitives:RadSlideView.ItemTemplate>
      
       </telerikPrimitives:RadSlideView>

The OrientationToAngleConverter simply takes as input the Orientation property of the image (which is an enumerator with the possible combinations) and returns the rotation angle that should be applied.
The problem is that the whole RadSlideView seems to be rotated, not just the image: when I'm on an image that has been artificially rotated using the RotateTransform, I need to swipe to the top to go to the next one and to swipe to the bottom go to the previous one. The problem seems to be connected to the RenderTransformOrigin property I'm using, but if I don't set it, since the origin point is not in the middle of the page, I simply can't see the rotated image because is out of the page.

Do you have any idea on how to fix this behavior?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 12 Jul 2013, 06:56 AM
Hello Matteo,

I answered your question in the support ticket you posted about the same issue.

Regards,
Victor
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
PanAndZoomImage
Asked by
QMatteoQ
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or