Comments (7)
Can you please try with Png image format, and PixelData to see if they also exhibit the behaviour.
from direct3dhook.
Disabled all my code inside using
and re-checked.
Both Bitmap
and Png
formats cause memory leak. Probably, Png
does it slower, but I'm not sure.
PixelData
does not. However, I need to improve my code to be able to use it.
from direct3dhook.
Ok thanks, not sure what changed to introduce that, fairly certain it was good for a while. I’ll try to take a look over the next month.
from direct3dhook.
I'm not very experienced in low level graphics programming, but I made some investigations with dotTrace. There is a leak of unmanaged memory allocated in SharpDX.WIC.Bitmap's constructor inside DXHookD3D11.ToStream.
I'll try to fix it by myself and will make a PR in case of success. Otherwise, I hope that my investigation will help you to find the problem and to fix it.
from direct3dhook.
Further investigations show that the converter.Initialize(bitmap, ...)
is the cause of memory leak. When this call happens, a bitmap can not Dispose
in a right way.
Disabled converter temporarily in my project, but I'm sure you can find a more elegant solution.
from direct3dhook.
@SladeThe yeah, I have missed wrapping the converter in a using clause in a recent update e.g. var converter = new SharpDX.WIC.FormatConverter(wicFactory);
becomes:
using (var converter = new SharpDX.WIC.FormatConverter(wicFactory))
{
...
}
from direct3dhook.
Yes. That helped, thanks. But doesn't really matter.
The following code works fine for me. Both with and without converter.
using (MemoryStream dataStream = new MemoryStream(screenshot.Data)) {
using (Bitmap bitmap = (Bitmap) Image.FromStream(dataStream)) {
from direct3dhook.
Related Issues (20)
- Attempt to update image element every frame in d3d11? HOT 4
- Question: Interactive UI Overlay HOT 2
- Strange exception HOT 1
- Failed injection in League of Legends HOT 9
- Error in InitialiseHook: System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception. HOT 1
- can I use this for simulate dirext input for games?
- Сhange of path *.dll
- cann't inject wow,error code:93913088 HOT 1
- Screenshot background window HOT 3
- Black screen when capturing from multiple clients HOT 8
- Captures Complete but Do Not Display, Overlay Does Not Display
- Region settings not correct. HOT 1
- Memory leak on screenshot HOT 5
- Memory leak on image draw HOT 2
- I need some help HOT 31
- Memory leak after unreasonable ammount of DrawOverlayInGame calls and large ImageElement HOT 7
- When creating an ImageElement with the "Bitmap bitmap" override, DXHookD3D11 throws an exception HOT 1
- What is CaptureInterface.StartRecording()? HOT 1
- Memory leakage HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from direct3dhook.