Skip to content

Commit

Permalink
BUG: Fix screen capture lightbox image background
Browse files Browse the repository at this point in the history
Background was not initialized to solid color and contained random content.
  • Loading branch information
lassoan committed May 15, 2020
1 parent 8207a3c commit 0bc7cb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Modules/Scripted/ScreenCapture/ScreenCapture.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,13 +1328,14 @@ def createLightboxImage(self, numberOfColumns, outputDir, imageFileNamePattern,
lightboxCanvas.SetNumberOfScalarComponents(3)
lightboxCanvas.SetScalarTypeToUnsignedChar()
lightboxCanvas.SetExtent(lightboxImageExtent)
lightboxCanvas.SetDrawColor(1.0, 1.0, 1.0)
# Fill background with black
lightboxCanvas.SetDrawColor(50, 50, 50)
lightboxCanvas.FillBox(*lightboxImageExtent[0:4])

drawingPosition = [column * (imageDimensions[0] + imageMarginSizePixels),
lightboxImageExtent[3] - (row + 1) * (imageDimensions[1] + imageMarginSizePixels)]
lightboxCanvas.DrawImage(drawingPosition[0], drawingPosition[1], image)

slicer.lb = lightboxCanvas
lightboxCanvas.Update()
outputLightboxImageFilePath = os.path.join(outputDir, lightboxImageFilename)
writer = self.createImageWriter(outputLightboxImageFilePath)
Expand Down

0 comments on commit 0bc7cb1

Please sign in to comment.