Closed Skyppid closed 5 years ago
You are likely disposing/destroying something that should not, so remove all dispose/destroy from your program and proceed from there
This is the same code I use to build textures from a bitmap source, and it works for me. there must be something else that's wrong.
Have you resolved this issue? Can we close this?
You can close this meanwhile. The issue came up because of something else. I can't remember right now, but I think the problem was that I mixed up things and used the wrong device.
Crosslink to Stackoverflow: Here
Well to test the integration of DirectX 11 into my WPF application I have to render some image. As of late I do get some misterious exceptions at various locations. One is the following, where I just copied the code of an old sample of SharpDX on how to import PNG/JPEGs with WIC and convert them to a Texture2D object.
Whenever I try to call
BitmapSource.CopyPixels(int, DataPointer)
I get an exception. Either a read-access violation at 0xF...F (-1) or write-access violation at 0x0...8. For further information check out the Stackoverflow thread.Here's the full code in chronological call-order: Source
For now my best guess is that there's something faulty in SharpDX's codebase. As said, I used the same code as in the sample. All projects of my solution use the latest 4.0.1 #DX libraries.
That's the sample I used: Link
EDIT: Tried to step into the code and check it out. Resulted in this exception: