prmr / JetUML

A desktop application for fast UML diagramming.
GNU General Public License v3.0
625 stars 125 forks source link

Add option to export high-resolution images #453

Closed prmr closed 2 years ago

prmr commented 2 years ago

The bitmaps produced through the Copy to Clipboard and Export Image features have the same resolution as the image in the editor. While this resolution is appropriate for use within the tool, it can lead to a pixelated look when the images are integrated as figures in other applications.

This feature is to add an option to scale the image x4 before exporting it. We can do this by applying a transform to Canvas#snapshot as follows:

SnapshotParameters spa = new SnapshotParameters();
spa.setTransform(Transform.scale(HIGH_DPI_SCALE_FACTOR, HIGH_DPI_SCALE_FACTOR));
canvas.snapshot(spa, image);

It's important that this is optional because the export function will take perceptibly longer, and the resulting images will be larger.

Thanks to Gabriel Cormier-Affleck for suggesting this feature and the implementation strategy.

prmr commented 2 years ago

The images end up blurry, the only true way to fix this is to have SVG export.