Zoom page or only image

9 posts, 0 answers
  1. Donato
    Donato avatar
    5 posts
    Member since:
    Jul 2012

    Posted 08 Jul 2012 Link to this post

    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
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 09 Jul 2012 Link to this post

    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 >>

  3. DevCraft banner
  4. Donato
    Donato avatar
    5 posts
    Member since:
    Jul 2012

    Posted 10 Jul 2012 Link to this post

    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...
  5. Donato
    Donato avatar
    5 posts
    Member since:
    Jul 2012

    Posted 12 Jul 2012 Link to this post

    So...I can visualize the main page of telerik but I can't visualize the code of template...
  6. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 13 Jul 2012 Link to this post

    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 >>

  7. Donato
    Donato avatar
    5 posts
    Member since:
    Jul 2012

    Posted 13 Jul 2012 Link to this post

    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?
  8. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 13 Jul 2012 Link to this post

    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 >>

  9. Donato
    Donato avatar
    5 posts
    Member since:
    Jul 2012

    Posted 13 Jul 2012 Link to this post

    Ah thanks...

    For the resource file...I don't understand you...Can you post here the code? Thank you very much!
  10. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 16 Jul 2012 Link to this post

    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.

Back to Top
DevCraft banner