Commit f546a898 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

BUG: vtkWindow::Set/GetPixelData describes a region of the screen by the

inclusive extents of the region you want to read, not by a corner and the
size.  Therefore, you have to subtract one from the width and height with
reading and writing the whole image.
parent 8675d88d
......@@ -272,7 +272,8 @@ void QVTKWidget::saveImageToCache()
{
if (this->cachedImageCleanFlag) return;
this->mRenWin->GetPixelData(0,0,width(), height(), 1, this->mCachedImage);
this->mRenWin->GetPixelData(0, 0, this->width()-1, this->height()-1, 1,
this->mCachedImage);
this->cachedImageCleanFlag = true;
emit cachedImageClean();
}
......@@ -378,7 +379,8 @@ void QVTKWidget::paintEvent(QPaintEvent* )
if (this->cachedImageCleanFlag)
{
// put cached image into back buffer if we can
this->mRenWin->SetPixelData(0,0,width(), height(), this->mCachedImage,
this->mRenWin->SetPixelData(0, 0, this->width()-1, this->height()-1,
this->mCachedImage,
!this->mRenWin->GetDoubleBuffer());
// swap buffers, if double buffering
this->mRenWin->Frame();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment