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

Save content of each tileview container as image

1 Answer 33 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Sandra
Top achievements
Rank 1
Sandra asked on 19 Jun 2013, 07:12 AM
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

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 24 Jun 2013, 06:37 AM
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.

Tags
TileView
Asked by
Sandra
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or