Save content of each tileview container as image

2 posts, 0 answers
  1. Sandra
    Sandra avatar
    1 posts
    Member since:
    Jun 2013

    Posted 19 Jun 2013 Link to this post

    Hi,

    I am creating an application using WPF, MVVM , C#.
    I am just wondering if there is a way to save each tile of a RadTileView as image.

    So far I manage to save the whole tileview by using the following code:

     private void SaveTileView()
            {
                var imagePath = "C:\\Users\\" + "TestSciChart" + Random.Next(200) + ".png";

                using (Stream stream = new FileStream(imagePath, FileMode.Create))
                {
                    var encoder = new TiffBitmapEncoder();
                    Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(
                        ChartTileView, stream, encoder);
                }
            }

    but I haven been able to save each tile separately? Can someone help me please?

    this is my tileview declaration:

    <telerik:RadTileView    x:Name="ChartTileView"
                                        telerik:PersistenceManager.StorageId="ChartTileView"
                                        Margin="0" Padding="0"
                                        VerticalContentAlignment="Top"
                                        VerticalAlignment="Stretch" 
                                        HorizontalAlignment="Stretch"
                                   ColumnsCount="1"
                                   IsAutoScrollingEnabled="True"
                                   IsDockingEnabled="True"
                                   IsVirtualizing="True"
                                   ItemsSource="{Binding Views}"
                                   ItemTemplate="{StaticResource HeaderTemplate}"
                                        ColumnWidth="*"
                                        RowHeight="250"   
                                        MaximizeMode="Zero" 
                                   TileStateChangeTrigger="SingleClick">
                </telerik:RadTileView>


    Thanks so much.

    Sandra
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 24 Jun 2013 Link to this post

    Hello Sandra,

    As this question is not directly related to any of RadControls for WPF we consider it as general programming question which is out of the scope of our support services. However, you may find this article interesting or you can try to get more help on other community-driven online resources, such as StackOverflow.

    Regards,
    Pavel R. Pavlov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top