Skip to content

Commit

Permalink
优化 截图性能
Browse files Browse the repository at this point in the history
修复 插件卸载错误
  • Loading branch information
MakesYT committed Dec 25, 2024
1 parent 7380e93 commit 92e1dce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Core.Window/ScreenCapture/ScreenCaptureByWGC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ public ScreenCaptureResult CaptureScreenBitmap(ScreenCaptureResult captureAllScr
new Vector(96, 96), PixelFormat.Bgra8888 );
using (var l = writeableBitmap.Lock())
{
for (var r = 0; r < captureAllScreenInfo.Info.Height; r++)
Marshal.Copy(captureAllScreenInfo.Bytes, r * captureAllScreenInfo.Info.Width * 4,
new IntPtr(l.Address.ToInt64() + r * l.RowBytes),
captureAllScreenInfo.Info.Width * 4);
Marshal.Copy(captureAllScreenInfo.Bytes,0,l.Address, captureAllScreenInfo.Info.Width * 4 * captureAllScreenInfo.Info.Height);

}

captureAllScreenInfo.Bytes = null;
Expand Down
2 changes: 1 addition & 1 deletion Core/SDKs/CustomType/ObservableDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public KeyValuePair<TKey, TValue> GetByIndex(int index)

public new void Add(TKey key, TValue value)
{
base.Add(key, value);
base.TryAdd(key, value);
OnCollectionChanged(
new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, FindPair(key), _index));
OnPropertyChanged("Keys");
Expand Down

0 comments on commit 92e1dce

Please sign in to comment.