How to take screen shot in UEFI shell?
Basically program steps as below:
1. save video frame buffer to get screen pixel bitmap data
2. add bmp header to bitmap data, adjust the data to follow bmp spec, save it as bmp file.

Save frame buffer

UEFI console support protocol, graphic output protocol have a function Blt() can save frame buffer:

    //The Blt() function is used to draw the BltBuffer rectangle onto the video screen.
    EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt()
    //save frame buffer by EfiBltVideoToBltBuffer
    typedef enum {
    EfiBltVideoFill,
    EfiBltVideoToBltBuffer,
    EfiBltBufferToVideo,
    EfiBltVideoToVideo,
    EfiGraphicsOutputBltOperationMax
    } EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
    //Blt prototype
    typedef
    EFI_STATUS
    (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (
    IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
    IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
    IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
    IN UINTN SourceX,
    IN UINTN SourceY,
    IN UINTN DestinationX,
    IN UINTN DestinationY,
    IN UINTN Width,
    IN UINTN Height,
    IN UINTN Delta OPTIONAL
    );

BMP bitmap

Take 24bit bmp file for an example, the bmp header is 54 bytes(including 14 bytes bitmap file header and 40 bytes bitmap info. header), google the format of 24bit bmp file for more informations.
refer to Tim’s UEFI blog, image pixels are organized left-to-right and then top-to-bottom. Each image pixel consists of 32-bits. The first 8-bits in each pixel are the blue (0 = off, 255 = on), the next 8-bits are the green and the next 8-bits are the RED.

but the bitmap data of bmp file is different: starting in the lower left corner, going from left to right, and then row by row from the bottom to the top of the image.(Wiki).so Do adjust your bitmap pixel data to follow bmp file format before save it as bmp file.

Only in Graphic mode the blt can got video buffer, so you need to switch to graphic mode by use of SetMode() as EfiConsoleControlScreenGraphics. But please aware that setmode() will clear the screen to black.(SetMode will Set the video device into the specified mode and clears the visible portions of the output display to black.)

And you may noticed that ConsoleControl protocol is removed in EDK2, i heard that EDK2 is just the graphics screen, but i didn’t verify this.

Code Sample

my UEFI Screenshot sample on github

Refer

Christoph’s Projects please refer his rEFIt project
Another sample on github
biosengineer blogspot