我用這個代碼,以截屏每秒鐘有計時器,但它似乎是填補了我的內存(約30 MB每次取)...這是代碼:C#CopyFromScreen填補了內存
Bitmap bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(136, 93, 9, 0, new Size(1088-391, 1039-65), CopyPixelOperation.SourceCopy);
return bmpScreenshot;
有沒有辦法清除內存?
你需要'Dispose()'東西。 – SLaks