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

Exporting as .bmp

4 Answers 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jens
Top achievements
Rank 1
Jens asked on 18 Nov 2009, 12:52 PM
Hi,

We are using the export utilities to save a framework element as an image, using the following procedure:

Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage( element, output, new Telerik.Windows.Media.Imaging.BmpBitmapEncoder() ); 


When exporting to .bmp files, the file is sometimes corrupted or its contents are misaligned. This problem only seems to occur when exporting to .bmp (the other formats seem to work fine).

I could reproduce the same problem using your charting demo when resizing the browser window in a way that not all contents of the chart are visible. I have attached a file showing the misalignment. (I converted the .bmp to a .png, as bitmaps cannot be uploaded.)

Do you have any ideas how to solve this problem?

Cheers,
Jens

4 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 20 Nov 2009, 08:49 AM

Hi Jens,

Thank you for the sample that shows the misalignment in the exported BMP image.
We've reproduced the problem.
We will update the exporting to BMP image in the nearest internal build.

Greetings,
Andrey Murzov
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
LaDonna
Top achievements
Rank 1
answered on 02 Jan 2015, 07:47 PM
We are using version v4.0.30319 and having this same issue exporting the image into a BMP file.  We've had the same code in place for years, and periodically upgrade to newer versions of Telerik, and we just noticed that this functionality has stopped working for us.  Is there another fix that is needed for BMP exports?

Thank you!
0
LaDonna
Top achievements
Rank 1
answered on 02 Jan 2015, 07:55 PM
I meant to write that we have this same issue using PNG files, and not BMP, but the same issue.  Thanks again for your help!
0
LaDonna
Top achievements
Rank 1
answered on 05 Jan 2015, 05:15 PM
Was helped through support ticket and told to change code as follows:

The default Template of RadMap has changed during the last years and I guess the first ItemsPresenter is not the one you need. You can try the following code:
Copy codepublic void saveImage(Stream stream){    var presenters = this.radMap.ChildrenOfType<ItemsPresenter>().ToList();    if (presenters != null && presenters.Count > 1)    {        FrameworkElement element = presenters[1];        Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(element, stream, new Telerik.Windows.Media.Imaging.PngBitmapEncoder());    }}

This solved my issue!  Thanks!
Tags
General Discussions
Asked by
Jens
Top achievements
Rank 1
Answers by
Andrey
Telerik team
LaDonna
Top achievements
Rank 1
Share this question
or