# How to include markup annotations in high-resolution screen capture

**URL:** <https://discourse.slicer.org/t/how-to-include-markup-annotations-in-high-resolution-screen-capture/35813>\
**Category:** Development\
**Tags:** module\
**Created:** [April 29, 2024, 6:13pm UTC](https://discourse.slicer.org/t/how-to-include-markup-annotations-in-high-resolution-screen-capture/35813 "2024-04-29T18:13:50Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 1, 2024, 10:35pm UTC](https://discourse.slicer.org/t/how-to-include-markup-annotations-in-high-resolution-screen-capture/35813/11 "2024-05-01T22:35:11Z")

</div>

> [@Davide\_Punzo](#):
>
> I am not sure of your requirements, but another simple option, it could be to instantiate a 3D widget outside the view layout,

That’s a great idea!

You can resize the window to any size - does not matter how large your display is (I’ve tested it on Windows, I don’t see a reason why it would not work on other operating systems or window managers). So, a code snippet to render a 3D view at arbitrarily high resolution:

Set up a 3D view outside the main view layout:

```python
# Switch to a layout that has a window that is not in the main window
layoutManager = slicer.app.layoutManager()
originalLayout = layoutManager.layout
layoutManager.setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutDualMonitorFourUpView)
# Maximize the 3D view within this layout
viewLogic = slicer.app.applicationLogic().GetViewLogicByLayoutName("1+")
viewNode = viewLogic.GetViewNode()
layoutManager.addMaximizedViewNode(viewNode)

```

Now set up visualization in the 3D view (e.g., drag-and-drop an image to show it with volume rendering).

```python
# Resize the view
viewWidget = layoutManager.viewWidget(viewNode)
# Parent of the view widget is the frame, parent of the frame is the docking widget
layoutDockingWidget = viewWidget.parent().parent()
originalSize = layoutDockingWidget.size
layoutDockingWidget.resize(3000,3000)
# Capture the view
import ScreenCapture
cap = ScreenCapture.ScreenCaptureLogic()
cap.captureImageFromView(viewWidget.threeDView(), "c:/tmp/test.png")
# Restore original size and layout
layoutDockingWidget.resize(originalSize)
layoutManager.setLayout(originalLayout)

```

Since this is a regular 3D view, everything will just work - markups will appear the same way as in any other view, you can use it with screen capture module to capture videos, etc.

---

_[View the full topic](https://discourse.slicer.org/t/how-to-include-markup-annotations-in-high-resolution-screen-capture/35813)._
