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

RadDocumentPane contents as a PNG image

7 Answers 143 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Deepak Vasudevan
Top achievements
Rank 2
Deepak Vasudevan asked on 04 Feb 2011, 07:08 PM
Dear Telerik Team,

I am trying to get the entire view of RadDocumentPane (Telerik.Windows.Control.RadDocumentPane) as a screenshot with the syntax like  below:

WriteableBitmap bitmap = new WriteableBitmap(diagram, null);

where diagram is pane.content (pane being an instance of RadDocumentPane). The catch is that only whatever is visible gets saved. I would like the entire contents of RadDocumentPane should be captured into the WriteableBitmap.

Can you highlight and help please?

7 Answers, 1 is accepted

Sort by
0
Accepted
George
Telerik team
answered on 09 Feb 2011, 01:54 PM
Hi Deepak,


We will greatly appreciate a sample project of yours. It will definitely help us in further pinpointing and resolving the problem. Can you attach the sample project to this thread? 



Regards,
George
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Deepak Vasudevan
Top achievements
Rank 2
answered on 08 Mar 2011, 05:03 PM
Dear George, 

I am unable to attach the sample project. The size is 5 mega bytes but your allowed attachment is 2 mega bytes. I am not also able to create a support ticket as it says:

We are sorry, but your support package is not active.

This is due to one of the following reasons:

  • You are not the assigned licensed user for your purchase. To check the licensed user please go to Licensed Users List.
  • Your 60 day trial support period has expired. If you would like to request a trial and support extension, please use the online Feedback form.
  • The 1 year Support package associated with your developer license has expired. Please, visitRenewals and Upgrades for upgrade/renewal options.

You can still use the available online support resources to help you with your development.


Can you please help?

Deepak Vasudevan
0
George
Telerik team
answered on 11 Mar 2011, 10:44 AM
Hi Deepak,

Could you please send us a screenshots of what you want to achieve? It will shed some light on the problem.

Greetings,
George
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Deepak Vasudevan
Top achievements
Rank 2
answered on 12 Mar 2011, 12:01 AM
Dear George, 

Please find the screenshot 1.png attached. You can find a textbox that sits within a RadDocumentPane. The textbox contains some text like 

This is a long textbox that contains some sentences. Telerik RadDocumentPane is expected to catch the entire as JPeg.

For illustration I have given a text. In the actual scenario it contains various other elements and diagrams. The objective is that RadDocumentPane should give the entire RadDocumentPane as a WriteableBitMap whereas it just gives whatever is visible. 

I have also sent the sample project with the subject "Unable to post support ticket" on 3/8 to sales@telerik.com and clientservice@telerik.com. 

Pl. help...

0
George
Telerik team
answered on 17 Mar 2011, 01:06 PM
Hello Deepak,

 
Thank you for sending us the project. I would suggest you to pass the content of the ScrollViewer as parameter. Please, refer to the following code snippet:

if (DiagramPaneGroup.SelectedItem != null)
                {
                    RadDocumentPane pane = (RadDocumentPane)DiagramPaneGroup.SelectedItem;
                    if (pane.Content is sample1)
                    {
                        sample1 content = (sample1)pane.Content;
                        var scrollViewer = content.ChildrenOfType<ScrollViewer>().FirstOrDefault();
                        if (scrollViewer != null)
                        {
                            var diagram = scrollViewer.Content as UIElement;
                            WriteableBitmap bitmap = new WriteableBitmap(diagram, null);
                            if (bitmap != null)
                            {
                                SaveFileDialog saveDlg = new SaveFileDialog
                                {
                                    Filter = @"JPEG Files (*.jpeg)|*.jpeg",
                                    DefaultExt = @".jpeg"
                                };
....



All the best,
George
the Telerik team
0
Deepak Vasudevan
Top achievements
Rank 2
answered on 17 Mar 2011, 10:18 PM
Dear Telerik Team,

There was no effect. It still displayed only the area which was in the view (and not took the scroll). Things got worse. Now I am getting a reversing of the stylesheets.

Do you have a sample application that uses your snippet and demonstrates this workaround please?

Deepak Vasudevan
0
George
Telerik team
answered on 23 Mar 2011, 10:40 AM
Hello Deepak,

 
Attached you can find the modified example. I hope this helps.

Regards,
George
the Telerik team
Tags
General Discussions
Asked by
Deepak Vasudevan
Top achievements
Rank 2
Answers by
George
Telerik team
Deepak Vasudevan
Top achievements
Rank 2
Share this question
or