mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Editor plugin: Image
This commit is contained in:
@ -226,7 +226,7 @@ bool EditorPlugin::save()
|
||||
const pdf::PDFPageContentImageElement* elementImage = element->asElementImage();
|
||||
const pdf::PDFPageContentElementTextBox* elementTextBox = element->asElementTextBox();
|
||||
|
||||
// TODO: Impelement all things
|
||||
// TODO: Implement all things
|
||||
|
||||
if (editedElement)
|
||||
{
|
||||
@ -263,11 +263,35 @@ bool EditorPlugin::save()
|
||||
contentStreamBuilder.writeStyledPath(path, elementLine->getPen(), elementLine->getBrush(), true, false);
|
||||
}
|
||||
|
||||
if (elementDot)
|
||||
{
|
||||
QPen pen = elementDot->getPen();
|
||||
const qreal radius = pen.widthF() * 0.5;
|
||||
|
||||
QPainterPath path;
|
||||
path.addEllipse(elementDot->getPoint(), radius, radius);
|
||||
|
||||
contentStreamBuilder.writeStyledPath(path, Qt::NoPen, QBrush(pen.color()), false, true);
|
||||
}
|
||||
|
||||
if (elementFreehandCurve)
|
||||
{
|
||||
QPainterPath path = elementFreehandCurve->getCurve();
|
||||
contentStreamBuilder.writeStyledPath(path, elementFreehandCurve->getPen(), elementFreehandCurve->getBrush(), true, false);
|
||||
}
|
||||
|
||||
if (elementImage)
|
||||
{
|
||||
QImage image = elementImage->getImage();
|
||||
if (!image.isNull())
|
||||
{
|
||||
contentStreamBuilder.writeImage(image, elementImage->getRectangle());
|
||||
}
|
||||
else
|
||||
{
|
||||
// It is probably an SVG image
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user