Problem with Direct3D Surface.LockRectangle & GraphicsStream

  • 10 years ago

    Hello All,
    I am pretty new to Direct3D.. I am facing a problem while trying to render from a viewer to a bitmap. I am using the Surface object where in I do a lockRectangle. GraphicsStream returned by Surface.LockRectangle()contains null data pointer. SO hence to render the same again, I try to do an unlockRectangle() again... and it gives me an exception saying -> "operation not valid due to the current state of the object". Can anybody help me with this.. and tell me why the data pointer in the GRaphicsStream is null and how to retry the surface.LockRectagle.. or how do I get a valid data pointer again ? And moreover the exception runs in a loop .. and does not occur always.. happens at random.... Has anybody faced such a similar situation ?? If yes, do let me know how to tackle this one ? thanks in advance.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are 10 types of people in the world, those who can read binary, and those who can't.”