|
@@ -149,6 +149,29 @@ WorkArea::saveStrengthLine (const std::string & filename)
|
|
|
|
|
|
void
|
|
|
WorkArea::exportPNG (const std::string & filename)
|
|
|
+{
|
|
|
+ QImage tempImg(*original);
|
|
|
+ QPainter painter(&tempImg);
|
|
|
+
|
|
|
+ for (int i = 0; i < liste_points.length (); i++)
|
|
|
+ {
|
|
|
+ if ((i % 2) == 1)
|
|
|
+ {
|
|
|
+ painter.setPen (QPen (Qt::red, epaisseurLigne/resizeFactor));
|
|
|
+ std::pair < QPoint *, QPoint * > endPoints =
|
|
|
+ StrengthLine (liste_points[i - 1], liste_points[i]).toDraw (tempImg.width()*resizeFactor, tempImg.height()*resizeFactor);
|
|
|
+
|
|
|
+ painter.drawLine (*(std::get < 0 > (endPoints))/resizeFactor,
|
|
|
+ *(std::get < 1 > (endPoints))/resizeFactor);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ tempImg.save(QString::fromStdString (filename));
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void
|
|
|
+WorkArea::exportJPG (const std::string & filename)
|
|
|
{
|
|
|
QImage tempImg(*original);
|
|
|
QPainter painter(&tempImg);
|
|
@@ -158,7 +181,7 @@ WorkArea::exportPNG (const std::string & filename)
|
|
|
{
|
|
|
painter.setPen (QPen (Qt::red, epaisseurLigne/resizeFactor));
|
|
|
std::pair < QPoint *, QPoint * > endPoints =
|
|
|
- StrengthLine (liste_points[i - 1], liste_points[i]).toDraw (&tempImg);
|
|
|
+ StrengthLine (liste_points[i - 1], liste_points[i]).toDraw (tempImg.width()*resizeFactor, tempImg.height()*resizeFactor);
|
|
|
painter.drawLine (*(std::get < 0 > (endPoints))/resizeFactor,
|
|
|
*(std::get < 1 > (endPoints))/resizeFactor);
|
|
|
}
|