RadDocumentPane contents as a PNG image

8 posts, 1 answers
  1. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 04 Feb 2011 Link to this post

    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?

  2. Answer
    George
    Admin
    George avatar
    1332 posts

    Posted 09 Feb 2011 Link to this post

    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>>
  3. DevCraft banner
  4. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 08 Mar 2011 Link to this post

    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
  5. George
    Admin
    George avatar
    1332 posts

    Posted 11 Mar 2011 Link to this post

    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!
  6. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 11 Mar 2011 Link to this post

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

  7. George
    Admin
    George avatar
    1332 posts

    Posted 17 Mar 2011 Link to this post

    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
  8. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 17 Mar 2011 Link to this post

    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
  9. George
    Admin
    George avatar
    1332 posts

    Posted 23 Mar 2011 Link to this post

    Hello Deepak,

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

    Regards,
    George
    the Telerik team
Back to Top
DevCraft banner