Overview
If you want to take snapshots of your code in MakeCode, you can do so easily.
Snapshot
You can save a .png file with an image of all the blocks in your current project using the Snapshot tool. This is particularly useful if you are creating digital or printable classroom resources or have a large number of blocks in your project.
To use the Snapshot tool in MakeCode, right-click on a blank area of the Workspace (press and hold on touch devices) and select 'Snapshot' from the pop-up menu options. Amend the snapshot filename and click 'Save'.
If you don't amend the filename or saved location, by default, the file will be named 'microbit-screenshot' and saved in the Downloads folder.

Taking a snapshot of the screen allows you to save a .png file, which shows all the blocks in the project:
Using Format Code and Zoom
If your project has a large number of blocks, it may also be helpful to select 'Format Code' beforehand to improve the layout before using the 'Snapshot' tool. The Format Code will align your blocks across the top central view of the workspace, as shown in the snapshot above. You may still need to rearrange some of the blocks to meet your resource requirements. This can be further aided by adjusting the zoom view to achieve the best layout result for your project.