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)
how to capture screen and convert to gif?
mc
6,861
Reputation points
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
3 answers
Sort by: Most helpful
-
Castorix31 91,871 Reputation points2022-10-19T07:27:58.79+00:00 -
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
-
Xiaopo Yang - MSFT 12,736 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 .