C# 使用Shellfile获取位图源更改窗口大小
我这行代码把一切都搞糟了C# 使用Shellfile获取位图源更改窗口大小,c#,winforms,bitmap,windows-api-code-pack,C#,Winforms,Bitmap,Windows Api Code Pack,我这行代码把一切都搞糟了 private void button1_Click(object sender, EventArgs e) { BitmapSource bitmapSource = ShellFile.FromFilePath(@"myfilepath").Thumbnail.ExtraLargeBitmapSource; } 因此,在这一行代码运行之后,整个窗口的大小将被重新调整,这似乎与分辨率和DPI有关。我怎样才能
private void button1_Click(object sender, EventArgs e)
{
BitmapSource bitmapSource =
ShellFile.FromFilePath(@"myfilepath").Thumbnail.ExtraLargeBitmapSource;
}
因此,在这一行代码运行之后,整个窗口的大小将被重新调整,这似乎与分辨率和DPI有关。我怎样才能解决这个问题
截图:
- 之前:
- 之后: