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

'Telerik.Windows.Controls.RadDiagram' does not contain a definition for 'ExportToImage'

1 Answer 104 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Shrikant
Top achievements
Rank 1
Shrikant asked on 23 Apr 2012, 10:54 AM
Hi Telerik Team,

In diagram Design Toolbox demo code, I am getting error on ExportToImage Function

Error :  'Telerik.Windows.Controls.RadDiagram' does not contain a definition for 'ExportToImage' and no extension method 'ExportToImage' accepting a first argument of type 'Telerik.Windows.Controls.RadDiagram' could be found (are you missing a using directive or an assembly reference?)

however,This function is not present in Demo Code at user side.
Telerik Version : 2012.1.215.1050

private void ExportToImage(bool isPng)
      {
          SaveFileDialog dialog = new SaveFileDialog();
          if (isPng)
          {
              dialog.DefaultExt = "PNG".ToLower();
              dialog.Filter = string.Format("{1} File (*.{0}) | *.{0}", "PNG".ToLower(), "PNG");
          }
          else
          {
              dialog.DefaultExt = "BMP".ToLower();
              dialog.Filter = string.Format("{1} File (*.{0}) | *.{0}", "BMP".ToLower(), "BMP");
          }
 
          if (!(bool)dialog.ShowDialog())
              return;
 
          Stream fileStream = dialog.OpenFile();
          if (isPng)
              this.diagram.ExportToImage(fileStream);
          else
              this.diagram.ExportToImage(fileStream, new BmpBitmapEncoder());
 
          fileStream.Close();
      }

1 Answer, 1 is accepted

Sort by
0
Accepted
Zarko
Telerik team
answered on 24 Apr 2012, 06:05 PM
Hello Shrikant,
The ExportToImage method was added to the RadDiagram with the 2012.1.306 internal build and that's why you're getting this error with older versions (2012.1.215).
If you want to use this functionality you'll have to download a newer version and if you have further questions please feel free to ask.

All the best,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Diagram
Asked by
Shrikant
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Share this question
or