How to tell memory usage of SharpDX.Direct2D1.Bitmap?

47 Views Asked by At

I am loading a bunch of images as bitmaps (of the type SharpDX.Direct2D1.Bitmap), and want to stop loading more, when the images take up a certain amount of memory (4gb in my case). The function i have, to tell the memory used, does width * height * 4 (since it is rgba). When using that method for System.Drawing.Bitmap, and checking with the task manager, it uses a bit more than 4gb, which is expected, since the bitmaps aren't the only thing using memory. However, when using SharpDX.Direct2D1.Bitmap, it only uses up 350mb total. Since the images still display correctly, i can conclude that no data is lost, which must mean that it is compressed. However i have no idea how to tell how much memory it uses in such a case. While it is not a critical problem, since it uses less memory than expected, i would like to make use of that fact.

So, does anyone know how to tell, how much memory a SharpDX.Direct2D1.Bitmap uses?

EDIT: turns out, it is loaded to gpu memory. I'd mark this as solved, but idk how. thanks @SimonMourier

1

There are 1 best solutions below

1
moqube On

turns out, it is loaded to gpu memory. thanks @SimonMourier