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

Export Guage as an Image

1 Answer 43 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
ravikiran jogu
Top achievements
Rank 1
ravikiran jogu asked on 11 Jun 2010, 03:32 PM
Hi, How do I export radguage into an Image file?

Thanks

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 15 Jun 2010, 10:29 AM
Hi Ravikiran Jogu,

You can use following code to same gauge image to file:

private void ExportToImage()
{
    SaveFileDialog saveImage = new SaveFileDialog();
    saveImage.Filter = "Bitmap (*.bmp)|*.bmp|PNG (*.png)|*.png";
    if (saveImage.ShowDialog() == true)
    {
        BitmapEncoder encoder = null;
        if (saveImage.SafeFileName.ToLower().EndsWith(".png"))
        {
            encoder = new PngBitmapEncoder();
        }
        else
        {
            encoder = new BmpBitmapEncoder();
        }
  
        using (Stream fileStream = saveImage.OpenFile())
        {
            ExportExtensions.ExportToImage(this.radGauge, fileStream, encoder);
        }
    }
}


All the best,
Andrey Murzov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Gauge
Asked by
ravikiran jogu
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or