Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[chemclipse-dev] The overlap problem of plotarea and axis in ChromatogramEditor when printing

Hi all,

When I print the chromatogram, I found that the plotarea and axis overlap especially called draw2d.SWTGraphics.scale(). The code is shown below:

Printer printer = new Printer(printerdata);
GC gc = new GC(printer);
if (printer.startJob("pdf")) {
     printer.startPage();

     Point screenDPI = Display.getCurrent().getDPI();
     Point printerDPI = printer.getDPI();
float scaleFactorX = printerDPI.x * 1.0f / screenDPI.x;
float scaleFactorY = printerDPI.y * 1.0f / screenDPI.y;

SWTGraphics graphics = new SWTGraphics(gc);
graphics.setLineAttributes(new LineAttributes(1.0f));

graphics.scale(scaleFactorX, scaleFactorY);

ChromatogramEditorMSD.chromatogramUI.print(gc);

graphics.dispose();
gc.dispose();
printer.endPage();
}
printer.endJob();
printer.dispose();

Best regards,

Y.M Zhou

Back to the top