Page 1 of 1

Exporting High resolution images

Posted: Fri Nov 01, 2013 11:12 pm
by symbolick
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 7655 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

Re: Exporting High resolution images

Posted: Sun Nov 03, 2013 3:26 pm
by ArctionPasi
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.

Re: Exporting High resolution images

Posted: Mon Nov 04, 2013 6:33 pm
by symbolick
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