This is what I see:

This is what I want:
Я попытался уменьшить размер изображения, но он не работал
Это часть исходного кода:
> 16) & 0xffff);
var height = (int)((long)lParam & 0xffff);
var round = Math.Min(width, height);
IntPtr hBitmap = IntPtr.Zero;
try
{
var adaptedSize = new System.Drawing.Size(round, round);
hBitmap = CreateBitmap(_iconicThumbnailImage, adaptedSize);
_ = Win32.DwmSetIconicThumbnail(hwnd, hBitmap, 0);
}
finally
{
Win32.DeleteObject(hBitmap);
}
handled = true;
}
if (msg == WM_DWMSENDICONICLIVEPREVIEWBITMAP)
{
IntPtr hBitmap = IntPtr.Zero, offsetPtr = IntPtr.Zero;
try
{
var aspectRatio = 1.0f * _iconicThumbnailImage.PixelWidth / _iconicThumbnailImage.PixelHeight;
var adaptedSize = AdjustBitmapSize(in aspectRatio, _iconicThumbnailImage.PixelWidth, _iconicThumbnailImage.PixelHeight);
var offsetX = (int)((AppCore.MainWindow.Width - adaptedSize.Width) / 2);
var offsetY = (int)((AppCore.MainWindow.Height - adaptedSize.Height) / 2);
var offset = new System.Drawing.Point(offsetX, offsetY);
offsetPtr = Marshal.AllocHGlobal(Marshal.SizeOf());
Marshal.StructureToPtr(offset, offsetPtr, false);
hBitmap = CreateBitmap(_iconicThumbnailImage, adaptedSize, true);
_ = Win32.DwmSetIconicLivePreviewBitmap(hwnd, hBitmap, offsetPtr, Win32.DWM_SIT.None);
}
finally
{
Win32.DeleteObject(hBitmap);
Marshal.FreeHGlobal(offsetPtr);
}
handled = true;
}
return IntPtr.Zero;
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... l-function