Feature #3483

Mis à jour par Sebastien Jacquot il y a presque 2 ans

Add some user global preferences to manage the printing or displaying dimensions/Megapixels of the bitmap files produced by the commands "Export\Chart..." and "Export view".
The UI should shows to the user what dimensions in centimeters will be optimum according to user selected width in pixels and DPI.

h3. Solution 1

*[SJ: WIP]*

Store a user preference "ChartPixelsWidth" at ChartsEngine level.

*In RCP preference page*

Set these writable fields:

* Pixels Width
integer field, default value: based on user screen?, max value: 8K = 7680 px?
* DPI
list of values: 72, 96, 150, 300, 400, 600

Set these read-only fields:

* Width in centimeters
* Height in centimeters

When changing value of the "Pixels Width" field, compute width and height according to the width and the selected DPI and fill the fields "Width in centimeters" and "Height in centimeters".

h3. Solution 2

Since the export purpose is to display a chart on a screen or to print it, it may be better to permit to set the final width in centimeters according to the selected DPI resolution. Therefore the fields may become:

* Display or print width from DPI (writable)
* DPI Resolution (writable)

and the field "Pixels Width" will become readable only and computed from the 2 others fields, to inform the user.
Unfortunately, it's not possible to automatically retrieve the DPI screen resolution.

h3. Notes


*For command "Export view"*

The current behavior is to produced a file with the same dimensions of pixels than the chart windows pixels dimensions that is displayed on the screen.
The height must be computed according to "Pixels Width" preference and the original chart windows aspect ratio.

*For command "Export\Chart..."*

The current behavior is to produced a file with pixels dimensions of 1024 x 576.
We can use the "Pixels Width" preference to manage the width exported file width but since we do not have a chart windows we can not compute a height based on the viewed chart.
Need to specify how to compute the height.
Using a "Pixels Height" preference doesn't seems to be the best solution.
A better solution may be to use the aspect ratio of the user screen resolution to compute the height.

NOTE: the behavior seems to have changed using JFC Charts Engine since we store now the chart object (maybe since 0.8.0). Therefore, if the chart has been zoomed, etc., "Export\Chart..." will export the chart as is.

*Mixed preference"*

If we use the same fields and preference page for the 2 commands, it may confuse the user.
Especially if we use a "Pixels Height" preference that should not be used by "Export view". The purpose of the "Pixels width" value when using this command is only to scale the entire image but not to change its aspect ratio.

Retour