Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

截屏内存无限制上涨的问题 #77

Open
862256261 opened this issue Dec 28, 2023 · 7 comments
Open

截屏内存无限制上涨的问题 #77

862256261 opened this issue Dec 28, 2023 · 7 comments
Assignees

Comments

@862256261
Copy link

执行截屏后内存没有自动释放,请解决一下吧谢谢

yanjinhuagood added a commit that referenced this issue Dec 28, 2023
add in GC Collect
@yanjinhuagood
Copy link
Member

GC垃圾回收器会自动进行内存管理,并在需要时释放不再使用的对象。

@862256261
Copy link
Author

并没有回收啊,内存蹭蹭上涨

@862256261
Copy link
Author

1704785832226
1704785858207
1704785880857
这分别是初次打开程序的内存,截图完成第一次的内存,截图完成第二次的内存

@yanjinhuagood
Copy link
Member

正在解决中。

yanjinhuagood added a commit that referenced this issue Jan 13, 2024
#77 Fix issue
@yanjinhuagood yanjinhuagood self-assigned this Jan 13, 2024
@yanjinhuagood
Copy link
Member

  1. 请使用最新Nuget
  2. 下载体验

@yanjinhuagood
Copy link
Member

示例代码:

 private void ButtonExt_Click(object sender, RoutedEventArgs e)
 {
     var screenCaptureExt = new ScreenCaptureExt();
     screenCaptureExt.SnapCanceled += ScreenCaptureExt_SnapCanceled;
     screenCaptureExt.SnapCompleted += ScreenCaptureExt_SnapCompleted;
 }
 private void ScreenCaptureExt_SnapCompleted(System.Windows.Media.Imaging.BitmapSource bitmap)
 {
 }

 private void ScreenCaptureExt_SnapCanceled()
 {
     Message.Push($"{DateTime.Now} 取消截图",MessageBoxImage.Information);
 }

@yanjinhuagood
Copy link
Member

yanjinhuagood added a commit that referenced this issue Feb 5, 2024
Co-Authored-By: Deakin Tsang <35422654+deakintsang@users.noreply.github.com>

#89 #77 Fix Issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants