In Hurricane, make image snaphot great again.

This commit is contained in:
Jean-Paul Chaput 2017-11-18 12:14:56 +01:00
parent a8322252ce
commit 3b093bf129
4 changed files with 36 additions and 26 deletions

View File

@ -126,7 +126,8 @@ namespace Hurricane {
_flags = flags;
int scale = 80 * Cfg::getParamEnumerate("viewer.printer.mode")->asInt();
//int scale = 80 * Cfg::getParamEnumerate("viewer.printer.mode")->asInt();
int scale = (Graphics::isHighDpi()) ? 1 : 2;
_drawingWidth = _cellWidget->width () * scale;
_drawingHeight = _cellWidget->height() * scale;
@ -134,13 +135,23 @@ namespace Hurricane {
, _drawingHeight + ((_flags&ShowScale) ? 60 : 0)
, QImage::Format_RGB32 );
// Compute the delta size between CellImage and CellWidget.
// Compute the delta size between CellPrinter and CellWidget.
cerr << "Image/Screen settings:" << endl;
//cerr << " Screen Resolution (DPI): " << resolution() << endl;
cerr << " CellImage: " << geometry().width() << "x" << geometry().height() << endl;
cerr << " CellWidget: " << _cellWidget->geometry().width() << "x" << _cellWidget->geometry().height() << endl;
cerr << " ScreenCellWidget: " << _screenCellWidget->geometry().width() << "x" << _screenCellWidget->geometry().height() << endl;
cerr << " resize: " << _drawingWidth << "x" << _drawingHeight << endl;
cerr << " AbutmentBox: " << _cellWidget->getCell()->getAbutmentBox() << endl;
cerr << " visibleArea: " << _cellWidget->getVisibleArea() << endl;
// Compute the delta size between CellImage and CellWidget.
// cerr << "CellImage:" << geometry().width() << "x" << geometry().height() << endl;
// cerr << "CellWidget: " << _cellWidget->geometry().width() << "x" << _cellWidget->geometry().height() << endl;
// cerr << "resize: " << _drawingWidth << "x" << _drawingHeight << endl;
// cerr << "AbutmentBox:" << _cellWidget->getCell()->getAbutmentBox() << endl;
// cerr << "visibleArea:" << _cellWidget->getVisibleArea() << endl;
resize( _drawingWidth, _drawingHeight );
Box visibleArea = _screenCellWidget->getVisibleArea();
@ -152,8 +163,8 @@ namespace Hurricane {
}
cerr << " After resize CellWidget: " << _cellWidget->geometry().width() << "x" << _cellWidget->geometry().height() << endl;
cerr << "visibleArea(image):" << _cellWidget->getVisibleArea() << endl;
cerr << "visibleArea(screen): " << _screenCellWidget->getVisibleArea() << endl;
cerr << " VisibleArea(printer): " << _cellWidget->getVisibleArea() << endl;
cerr << " VisibleArea(screen): " << _screenCellWidget->getVisibleArea() << endl;
//cerr << "(xpaper,ypaper) = (" << xpaper << "," << ypaper << ")" << endl;
//cerr << "(w,h) = (" << w << "," << h << ")" << endl;

View File

@ -8,7 +8,7 @@
// | V L S I B a c k e n d D a t a - B a s e |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./CellPrinter.cpp" |
// +-----------------------------------------------------------------+

View File

@ -2,25 +2,24 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved
// Copyright (c) UPMC/LIP6 2012-2016, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Header : "./hurricane/viewer/CellImage.h" |
// +-----------------------------------------------------------------+
#ifndef __HURRICANE_CELL_IMAGE__
#define __HURRICANE_CELL_IMAGE__
#ifndef HURRICANE_CELL_IMAGE_H
#define HURRICANE_CELL_IMAGE_H
#include <list>
using namespace std;
#include <QMainWindow>

View File

@ -2,21 +2,21 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved
// Copyright (c) UPMC/LIP6 2012-2016, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Header : "./hurricane/viewer/CellPrinter.h" |
// +-----------------------------------------------------------------+
#ifndef __HURRICANE_CELL_PRINTER__
#define __HURRICANE_CELL_PRINTER__
#ifndef HURRICANE_CELL_PRINTER_H
#define HURRICANE_CELL_PRINTER_H
#include <list>