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

Problem With Direct3D Surface.LockRectangle & GraphicsStream

If not, post the C# examples you found here, and I will help bridge the syntax. Normally, the object or one of it's fields has to be pinned to avoid this problem. Privacy statement  © 2017 Microsoft. I use UInt because thats what the C# code used. http://dotbowl.com/problem-with/problem-with-ie-6-and-aol-4-0.html

Thursday, January 19, 2006 9:25 PM 0 Sign in to vote Roko has reopend the bug - if you can repro or have comments please go add your vote etc http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=0dda86da-a83f-475d-8610-d3a08a14cc7f If you call bitmap.Width bitmap.Width * bitmap.Height times, it's about as slow as Texture.FromBitmap while debugging in VS2005.I actually wrapped System.Drawing.Bitmap in my own class, which caches Width and Height, so Is my assumption wrong? For more information, see Width vs. https://forums.techguy.org/threads/problem-with-direct3d-surface-lockrectangle-graphicsstream.626953/

Has anybody faced such a similar situation ?? Make a suggestion Dev centers Windows Office Visual Studio Microsoft Azure More... Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic.

All rights reserved.Terms of Use|Trademarks|Privacy Statement|Site Feedback Technologies Windows Apps Internet of Things Holographic Microsoft Edge Hardware IT Center Microsoft Azure What is Azure Products Solutions Pricing Create a free account You have to do something like texture = new Texture(device, bitmap.Width, bitmap.Height, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default); Microsoft.DirectX.GraphicsStream a = texture.LockRectangle(0, LockFlags.None); System.Drawing.Imaging.BitmapData bd = bitmapitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); Back to top #15 ed209 Members 122 Like 0Likes Like Posted 09 July 2008 - 08:58 PM Well I'm just looking for something that won't freeze everytime I try Armin Wednesday, December 11, 2013 1:58 AM Reply | Quote Answers 0 Sign in to vote "It's actually..." Yes, I know.

Learning resources Microsoft Virtual Academy Channel 9 MSDN Magazine Community Forums Blogs Codeplex Support Self support Programs BizSpark (for startups) Microsoft Imagine (for students) United States (English) Newsletter Privacy & cookies The only lockable format for a depth stencil texture is Format.D16Lockable. Don't do that, it's just as slow as everything else you can do with the Bitmap. https://social.msdn.microsoft.com/Forums/en-US/967fef3f-9801-4a78-bdb9-3b2a7bf723ba/performance-problem-with-texturefrombitmap?forum=gametechnologiesdirectx101 Originally I thought the * is some kind of type so I checked with ildasm. "I was (also) wondering how to declare a native pinned pointer." Normally it should't be possible.

We appreciate your feedback. The only problem here is that I have no idea how come the code uses * instead of &. Back to top #14 Headkaze Members 607 Like 0Likes Like Posted 09 July 2008 - 08:37 PM There is hardly any difference between C# and VB.NET. Back to top #16 jollyjeffers GDNet+ 1558 Like 0Likes Like Posted 09 July 2008 - 10:00 PM Given the way these libraries are designed I would imagine you'll have

Be sure to copy to unlocked surfaces. This documentation is archived and is not being maintained. It's an unamanaged pointer (*) instead of a managed pointer (&). and it gives me an exception saying -> "operation not valid due to the current state of the object".

Back to top #6 EnochDagor Members 180 Like 0Likes Like Posted 08 July 2008 - 07:38 AM What is your VB.NET code?Why are you using UInts and not signed check my blog 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 Thanks again. If you dump the whole assembly and search for lines containing pinned and * you'll find more cases.

Texture.LockRectangle Method () Locks a rectangle on a texture resource. Overload List public GraphicsStream LockRectangle(int, LockFlags); public GraphicsStream LockRectangle(int, LockFlags, out int); public GraphicsStream LockRectangle(int, Rectangle, LockFlags); public GraphicsStream LockRectangle(int, Rectangle, LockFlags, out int); public Array LockRectangle(Type, int, LockFlags, out int, int[]); public Array Log in or Sign up Tech Support Guy Home Forums > Software & Hardware > Games > Computer problem? http://dotbowl.com/problem-with/problem-with-c1-01-1.html No, create an account now.

For me it was easy because I'm only using 32 bit textures and 32 bit bitmaps. Armin Edited by Armin Zingler Thursday, December 12, 2013 3:40 PM fmt Thursday, December 12, 2013 3:39 PM Reply | Quote 1 Sign in to vote I don't know if the Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic.

Advertisements do not imply our endorsement of that product or service.

Video memory textures cannot be locked, but must be modified by calling Device.UpdateSurface or Device.UpdateTexture. If yes, do let me know how to tackle this one ? GraphicsStream returned by Surface.LockRectangle()contains null data pointer. and does not occur always..

Monday, November 21, 2005 12:11 PM 0 Sign in to vote I am also having the same problem. Loading... piddy, Sep 21, 2007 #1 This thread has been Locked and is not open to further replies. have a peek at these guys or how do I get a valid data pointer again ?

Pitch. Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content. Tuesday, November 22, 2005 6:02 AM 0 Sign in to vote I bet you $5 mine is faster :) Tuesday, November 22, 2005 3:46 PM 0 Sign in to vote No, and does not occur always..

Thank you Friday, February 24, 2006 3:22 PM Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. Please don't ask me why. And moreover the exception runs in a loop .. It is also possible to specify a Rectangle that covers only a portion of the surface.

Register now! Never assume a constant display pitch. For more information, see Device.UpdateTexture. When using libraries like this the syntax is largely irrelevant and its the semantics that'll get you - you can code incorrectly in any language [wink]Whilst I'd also recommend C# over

If yes, do let me know how to tackle this one ? Textures created in video memory are lockable when created with Usage.Dynamic. Staff Online Now Cookiegal Administrator TerryNet Moderator valis Moderator Advertisement Tech Support Guy Home Forums > Software & Hardware > Games > Home Forums Forums Quick Links Search Forums Recent Posts That means, an object is moved by the GC while an unmanged function is writing to one of the fields of the object.

© Copyright 2017 dotbowl.com. All rights reserved.