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

Zoom page or only image

8 Answers 128 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.
Donato
Top achievements
Rank 1
Donato asked on 08 Jul 2012, 06:28 PM
Hi! Could I have the code for zoom a page in an app? Or only an image...
I have the xaml page but not the template...

 <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBlock Text="Tap on the image to enter pan and zoom mode"
                   Foreground="{StaticResource PhoneAccentBrush}"
                   Margin="12"/>
        <Image Grid.Row="1"
               Source="Images/comic.jpg"
               Margin="12, 0, 12, 0"
               Tap="Image_Tap"
               HorizontalAlignment="Left"/>
        
        <telerikPrimitives:RadWindow IsFullScreen="True"
                                     x:Name="window">
            <telerikPrimitives:RadWindow.OpenAnimation>
                <telerikCore:RadScaleAnimation StartScaleX="0"
                                               StartScaleY="0"
                                               EndScaleX="1"
                                               EndScaleY="1"/>
            </telerikPrimitives:RadWindow.OpenAnimation>
            <telerikPrimitives:RadWindow.CloseAnimation>
                <telerikCore:RadScaleAnimation StartScaleX="1"
                                               StartScaleY="1"
                                               EndScaleX="0"
                                               EndScaleY="0"/>
            </telerikPrimitives:RadWindow.CloseAnimation>
            <Grid>
                <TextBlock Text="Zoom and pan for a more detailed view"
                           Foreground="{StaticResource PhoneAccentBrush}"
                           Margin="0, 12, 0, 0"/>
                <slideView:PanAndZoomImage Grid.Row="1"
                                           ZoomMode="Free"
                                           x:Name="panZoom"
                                           MaximumZoom="4,4"
                                           Source="Images/comic.jpg"/>
            </Grid>
        </telerikPrimitives:RadWindow>
    </Grid>
</UserControl>



Thanks

8 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 09 Jul 2012, 07:24 AM
Hello Donato,

Thanks for writing. Please explain in more detail what you are trying to achieve. What do you mean by "I have the xaml page but not the template...".
I am looking forward to your reply.

Kind regards,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Donato
Top achievements
Rank 1
answered on 10 Jul 2012, 10:00 AM
I want to zoom an image...or better all the page of the app...

I have the xaml page that I have posted but in the mainpage.xaml.cs there are nothing...
0
Donato
Top achievements
Rank 1
answered on 12 Jul 2012, 10:01 PM
So...I can visualize the main page of telerik but I can't visualize the code of template...
0
Victor
Telerik team
answered on 13 Jul 2012, 07:15 AM
Hi Donato,

Thanks for writing.
Please explain more about this template. Where is it? What does it visualize? Are you trying to create a code viewer like in our examples application maybe?
I am looking forward to your reply.

All the best,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Donato
Top achievements
Rank 1
answered on 13 Jul 2012, 10:25 AM
Hi...

So...I need to zoom an image in the app...or better to zoom a page in the app...Can I do it with PanAnsZoom?
I have downloaded your package for windows phone...but in the template I can visualize only the main page.xaml...not the code of main page...
Do you understand me?
0
Victor
Telerik team
answered on 13 Jul 2012, 11:30 AM
Hello Donato,

Thanks for writing.
PanAndZoomImage only support zooming and panning on an image. In order to used it to zoom a page the only thing you can do is to take a picture of the page then use it with PanAndZoomImage. Since this is only a picture of the page you will not be able to interact with it apart from panning and zooming.

In order to visualize the page source, you have to include your source file inside your assembly as a resource and then read its contents at run-time. The you can display the source in a TextBlock. Any code highlighting or coloring you can either do manually or reuse our code viewer from our Examples application.

Kind regards,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Donato
Top achievements
Rank 1
answered on 13 Jul 2012, 11:37 AM
Ah thanks...

For the resource file...I don't understand you...Can you post here the code? Thank you very much!
0
Victor
Telerik team
answered on 16 Jul 2012, 09:23 AM
Hello Donato,

Thanks for writing.
To visualize a source file, you need to add a copy of the source file to your visual studio project and set its build action to Resource. Then, at run-time, you can get a stream to this resource and read it. The data read from the stream will be the source code as a string. Then with the string in memory, you can visualize it as required.

All the best,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PanAndZoomImage
Asked by
Donato
Top achievements
Rank 1
Answers by
Victor
Telerik team
Donato
Top achievements
Rank 1
Share this question
or