Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
24427d59
Commit
24427d59
authored
Aug 24, 2010
by
Yannick Verdie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt add byte per line information to fix a bug
parent
601e9af9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
window_QT.cpp
modules/highgui/src/window_QT.cpp
+3
-4
No files found.
modules/highgui/src/window_QT.cpp
View file @
24427d59
...
...
@@ -2348,7 +2348,7 @@ void ViewPort::updateImage(const CvArr *arr)
cvReleaseMat
(
&
image2Draw_mat
);
//the image in ipl (to do a deep copy with cvCvtColor)
image2Draw_mat
=
cvCreateMat
(
mat
->
rows
,
mat
->
cols
,
CV_8UC3
);
image2Draw_qt
=
QImage
(
(
uchar
*
)
image2Draw_mat
->
data
.
ptr
,
image2Draw_mat
->
cols
,
image2Draw_mat
->
rows
,
QImage
::
Format_RGB888
);
image2Draw_qt
=
QImage
(
image2Draw_mat
->
data
.
ptr
,
image2Draw_mat
->
cols
,
image2Draw_mat
->
rows
,
image2Draw_mat
->
step
,
QImage
::
Format_RGB888
);
//use to compute mouse coordinate, I need to update the ratio here and in resizeEvent
ratioX
=
width
()
/
float
(
image2Draw_mat
->
cols
);
...
...
@@ -2717,10 +2717,9 @@ void ViewPort::paintEvent(QPaintEvent* event)
void
ViewPort
::
draw2D
(
QPainter
*
painter
)
{
image2Draw_qt
=
QImage
(
(
uchar
*
)
image2Draw_mat
->
data
.
ptr
,
image2Draw_mat
->
cols
,
image2Draw_mat
->
rows
,
QImage
::
Format_RGB888
);
image2Draw_qt_resized
=
image2Draw_qt
.
scaled
(
viewport
()
->
width
(),
viewport
()
->
height
(),
Qt
::
IgnoreAspectRatio
,
Qt
::
SmoothTransformation
);
image2Draw_qt
=
QImage
(
image2Draw_mat
->
data
.
ptr
,
image2Draw_mat
->
cols
,
image2Draw_mat
->
rows
,
image2Draw_mat
->
step
,
QImage
::
Format_RGB888
);
image2Draw_qt_resized
=
image2Draw_qt
.
scaled
(
viewport
()
->
width
(),
viewport
()
->
height
(),
Qt
::
IgnoreAspectRatio
,
Qt
::
FastTransformation
);
//Qt::
SmoothTransformation);
painter
->
drawImage
(
0
,
0
,
image2Draw_qt_resized
);
//painter->drawImage(0,0,image2Draw_qt_resized);
}
//only if CV_8UC1 or CV_8UC3
...
...
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