how to capture screen and convert to gif?

mc 5,511 Reputation points
2022-10-12T00:46:53.447+00:00

I know how to capture view in self thread.

but do not know how to capture screen and convert to gif.

Windows development | Windows App SDK
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ricardo Sousa 76 Reputation points
    2022-10-14T01:14:47.703+00:00

    well on your keyboard has a key name ( PrtSc ) this is for print screen

    and save as png gif whatever

    if you want the code in VB net i can provide to you

    1 person found this answer helpful.
    0 comments No comments

  2. Castorix31 90,686 Reputation points
    2022-10-19T07:27:58.79+00:00

    In C#/WinUI, it works with IDXGIOutputDuplication::AcquireNextFrame then by converting the texture bits into WriteableBitmap
    then BitmapEncoder to save as GIF or any other supported format
    (tested on Windows 10 21H1)

    1 person found this answer helpful.
    0 comments No comments

  3. Xiaopo Yang - MSFT 12,731 Reputation points Microsoft External Staff
    2022-10-12T02:26:05.653+00:00

    There are many screen capture examples, Capturing an Image(GDI), Screen capture for HWND(Windows.Graphics.Capture API), DXGI desktop duplication sample(IDXGIOutputDuplication).
    Then you encode the frame data to gif using Windows Imaging Component .


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.