Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
698193a8
Commit
698193a8
authored
7 years ago
by
Clément Fauconnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix for screenshot tool not grabbing videos"
This reverts commit
b6f41165
.
parent
8a9edb36
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
UBBoardController.cpp
src/board/UBBoardController.cpp
+15
-14
No files found.
src/board/UBBoardController.cpp
View file @
698193a8
...
@@ -2127,28 +2127,29 @@ QUrl UBBoardController::expandWidgetToTempDir(const QByteArray& pZipedData, cons
...
@@ -2127,28 +2127,29 @@ QUrl UBBoardController::expandWidgetToTempDir(const QByteArray& pZipedData, cons
}
}
/**
* @brief Take a screenshot of part of the scene
* @param pSceneRect The area to capture, in the active scene's coordinates
*/
void
UBBoardController
::
grabScene
(
const
QRectF
&
pSceneRect
)
void
UBBoardController
::
grabScene
(
const
QRectF
&
pSceneRect
)
{
{
if
(
mActiveScene
)
if
(
mActiveScene
)
{
{
// Ideally we should render the scene directly to a QImage rather than use grabWindow;
QImage
image
(
pSceneRect
.
width
(),
pSceneRect
.
height
(),
QImage
::
Format_ARGB32
);
// this was the previous solution but it couldn't grab videos (QGraphicsVideoItem), so it
image
.
fill
(
Qt
::
transparent
);
// was changed to this admittedly more sketchy way of doing it.
QRectF
targetRect
(
0
,
0
,
pSceneRect
.
width
(),
pSceneRect
.
height
());
QPainter
painter
(
&
image
);
painter
.
setRenderHint
(
QPainter
::
SmoothPixmapTransform
);
painter
.
setRenderHint
(
QPainter
::
Antialiasing
);
mActiveScene
->
setRenderingContext
(
UBGraphicsScene
::
NonScreen
);
mActiveScene
->
setRenderingQuality
(
UBItem
::
RenderingQualityHigh
);
UBBoardView
*
view
=
mActiveScene
->
controlView
();
mActiveScene
->
render
(
&
painter
,
targetRect
,
pSceneRect
);
QPoint
pos
=
view
->
viewport
()
->
mapFromGlobal
(
view
->
mapToGlobal
(
view
->
mapFromScene
(
pSceneRect
.
topLeft
())))
+
QPoint
(
1
,
1
);
qreal
scale
=
systemScaleFactor
();
mActiveScene
->
setRenderingContext
(
UBGraphicsScene
::
Screen
);
QScreen
*
screen
=
UBApplication
::
controlScreen
();
// mActiveScene->setRenderingQuality(UBItem::RenderingQualityNormal);
mActiveScene
->
setRenderingQuality
(
UBItem
::
RenderingQualityHigh
);
QPixmap
image
=
screen
->
grabWindow
(
view
->
viewport
()
->
winId
(),
pos
.
x
(),
pos
.
y
(),
pSceneRect
.
width
()
*
scale
-
1
,
pSceneRect
.
height
()
*
scale
-
1
);
mPaletteManager
->
addItem
(
image
,
QPointF
(
0
,
0
),
1
/
scale
);
mPaletteManager
->
addItem
(
QPixmap
::
fromImage
(
image
)
);
selectedDocument
()
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
()));
selectedDocument
()
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
()));
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment