Exporting High resolution images

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

symbolick
Posts: 49
Joined: Thu May 16, 2013 8:24 pm

Exporting High resolution images

Post by symbolick » Fri Nov 01, 2013 11:12 pm

I have been using the SaveToFile function with some success to generate high resolution images of LC. It works very well with the exception the axis will add additional labels in once I scale up the resolution. I would like to get it to upscale the chart without changing what the axis is actually showing. The image below is a comparison between a chart and a exported image of a chart at 2560x1440. Note the image on the right of the attach picture was scaled down so that I could upload it, the original 2560x1440p file exceeds the upload limitation.
additionalAxisValues.PNG
additionalAxisValues.PNG (31.95 KiB) Viewed 5860 times
Below is the code I have been using to export the image, am i missing any tricks I could do to get the axis to render the same at higher resolutions as it does in the original image?

Code: Select all

  string theImgFile = GetImageFile();
                BitmapAntialiasOptions options = new BitmapAntialiasOptions();
                options.ActualPixelWeight = 1;
                options.ResolutionDivider = 1;
                options.BlurRadius = 0;
                _view._chart.SaveToFile(theImgFile, options, WidthInPixels, HeightInPixels);
Regards,
Aaron

User avatar
ArctionPasi
Posts: 1365
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Exporting High resolution images

Post by ArctionPasi » Sun Nov 03, 2013 3:26 pm

I think there's two ways to achieve that.

Solution 1. Define spacing manually. Set axis.AutoDivSpacing = false, and then use MajorDiv and MajorDivCount to control the spacing.

Solution 2. Before calling SaveToFile or SaveToStream, read all ticks with axis.GetMajorTicks(), and set them in axis.CustomTicks collection. Set also CustomTicksEnabled = true. Then, after the export is complete, set CustomTicksEnabled = false, then it gets back to your original div tick spacing.
LightningChart Support Team, PT

symbolick
Posts: 49
Joined: Thu May 16, 2013 8:24 pm

Re: Exporting High resolution images

Post by symbolick » Mon Nov 04, 2013 6:33 pm

Thank you, I decided to use your second solution since I have had a pretty good experience letting LC decide its own ticks. It worked well. :D

Regards,
Aaron