Home > Problem With > Problem With Direct3D Surface.LockRectangle & GraphicsStream

Problem With Direct3D Surface.LockRectangle & GraphicsStream

Last post 9/25/2007 3:52 AM by piddy07. 0 replies. 9/25/2007 3:52 AM piddy07 (0) Posts 1 Problems with Surface.LockRectangle.... If you want to follow this bug, or add your validation or vote then you can find it here:http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=0dda86da-a83f-475d-8610-d3a08a14cc7f Wednesday, November 30, 2005 6:22 AM 0 Sign in to vote The Accessing Surface Memory Directly Surface memory can be accessed directly by using the Surface.LockRectangle method. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]> SQL Server Developer Center   Sign in United States have a peek at this web-site

Make a suggestion Dev centers Windows Office Visual Studio Microsoft Azure More... It is also possible to specify a Rectangle that covers only a portion of the surface. A surface cannot be locked if it belongs to a resource assigned to the Pool.Default memory pool, unless it is a dynamic texture or was created using Device.CreateOffscreenPlainSurface. Back to top #5 ed209 Members 122 Like 0Likes Like Posted 08 July 2008 - 07:35 AM Error 1 Value of type 'Microsoft.DirectX.GraphicsStream' cannot be converted to 'UInteger'.

If yes, do let me know how to tackle this one ? Back buffer surfaces, which can be accessed using the Device.GetBackBuffer and SwapChain.GetBackBuffer methods, can be locked only if the swap chain was created with the PresentFlag property of the PresentParameters structure and tell me why the data pointer in the GRaphicsStream is null and how to retry the surface.LockRectagle.. Does it throw any error?

  1. The following list provides some tips for avoiding common problems associated with directly rendering surface memory.
  2. If you want to know the full story: I call the instance method Microsoft.DirectX.Direct3D.Surface.LockRectangle.Surface.LockRectangle stores the address of one of it's own fields in the "pinned" local V_3 (see IL code
  3. For more information, see Device.UpdateTexture.
  4. For more information about usages, see Usage.
  5. My Discussions Active Discussions Not Read Advanced Sort Discussions: Oldest to newest Newest to oldest Previous Discussion Next Discussion Page 1 of 1 (1 posts) Problems with Surface.LockRectangle....
  6. Always examine the pitch information returned by the Surface.LockRectangle method.
  7. You're using bitmap.Width and bitmap.Height in a loop.
  8. The method in question that I call from my VB code contains this local declaration: valuetype TypeName* modreq([mscorlib]System.Runtime.CompilerServices.IsVolatile) pinned modreq([mscorlib]System.Runtime.CompilerServices.IsVolatile) V_3) And these lines assign the address of one of the

I only checked the stride of the Bitmap which was always just it's width, but the stride of the Texture was not (I didn't see that first, cause there it's called When access to the surface memory is finished, the Surface.UnlockRectangle method should be called to unlock it. Style Default Style Contact Us Help Home Top RSS Terms and Rules Copyright © TechGuy, Inc. Thursday, December 12, 2013 5:03 PM Reply | Quote Moderator 0 Sign in to vote Mike, that's a plausible explanation.

Could someone please show me how this is done??? That means, an object is moved by the GC while an unmanged function is writing to one of the fields of the object. Yes, my password is: Forgot your password? If you wish to continue this conversation start a new topic.

We appreciate your feedback. It would be nice to see this function optimized in future releases of the SDK. Show Ignored Content As Seen On Welcome to Tech Support Guy! I am using the Surface object where in I do a lockRectangle.

If yes, do let me know how to tackle this one ? Regarding the declaration: It's in C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.Direct3D.dll, class Microsoft.DirectX.Direct3D.Surface, Method LockRectangleInternal (the only overload with 2 args). I know it's old and not supported, but I'm not going to replace it soon. I expect that, during the unmanaged function call, the object can not be moved because of the "pinned" keyword in the declaration line.

In C# you get a pinned & when you use something like "fixed (Point *p = &someObject.point) ..." and you get a non pinned * when you use something like Point http://olivettipc.com/problem-with/problem-with-xp-sp2-rc1.html It's an Enum value, but that again is an Int32 which is a primitive type, so pinning should be possible." It also contain non primitive data which makes it non blittable. GRaphicsStream.InternalDataPointer is null. Yours is not as bad as it could be, cause you call bitmap.Width only bitmap.Height times.

Unmanaged pointers aren't reported to the garbage collector so pinning probably has no effect. The only problem here is that I have no idea how come the code uses * instead of &. That was not the case in VS2003 though. Source Downloads and tools Windows 10 dev tools Visual Studio Windows SDK Windows Store badges Essentials API reference (Windows apps) API reference (desktop apps) Code samples How-to guides (Windows apps) Learning resources

I'm facing a strange exception that occurs randomly and that I've narrowed down in the past two days using Windbg. In opposite to the exception message when trying to do so, the object does contain primitive data. This documentation is archived and is not being maintained.

Don't do that, it's just as slow as everything else you can do with the Bitmap.

GRaphicsStream.InternalDataPointer is null. If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Marked as answer by Armin Zingler Thursday, December 12, 2013 10:50 PM Thursday, December 12, 2013 10:20 PM Reply | Quote Moderator 0 Sign in to vote Ok, thanks. In contrast unmanaged pointers (*) are never tracked.That pretty much means that it would be impossible for the GC to honor 'pinned' because it has not idea that the pointer exists.

GraphicsStream returned by Surface.LockRectangle()contains null data pointer. Thursday, December 12, 2013 9:13 PM Reply | Quote Moderator 0 Sign in to vote That makes sense. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]> Jump to content Toggle navigation Sign http://olivettipc.com/problem-with/problem-with-sis-305-vga.html It's an Enum value, but that again is an Int32 which is a primitive type, so pinning should be possible.

We appreciate your feedback. Resources Home Articles GameDev.net Forums Beginners Community Blogs GDNet+ Membership Image of the Day Members Industry Job Advertising Freelancer Ads Asset Marketplace GameDev.net Products About GameDev.net About Us Terms of Service and it gives me an exception saying -> "operation not valid due to the current state of the object". Monday, November 21, 2005 8:41 PM 0 Sign in to vote Don't know if it matters, but I copied mine line by line and used the Stride to calculate the starting