Rakka Rage Posted May 22, 2003 Posted May 22, 2003 i am trying to load a cursor from a stream with Color.Red being transparent... SurfaceLoader.FromStream(_surface, RS("Cursor.bmp"), Filter.None, Color.Red.ToArgb()); but all the SurfaceLoader.FromStream methods take an existing Surface unlike the TextureLOader.FromStream methods which return a texture... so what am i supposed to do? make a new surface first? there are no empty contructors for Surface the only one that seems to work is _surface = new Surface(_d3dd, RS("Cursor.bmp"), Pool.Default); which basically does the same thing as the SurfaceLoader.FromStream except making the Color.Red transparent... so i have to "load" the suface twice to achieve this??? if only SurfaceLoader.FromStream returned the new Surface instead of taking it as a parameter... or am i doing it wrong? use TextureLoader? Quote
AndreRyan Posted May 23, 2003 Posted May 23, 2003 can you just "New Surface(Device)" then use that in SurfaceLoader? Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Rakka Rage Posted May 23, 2003 Author Posted May 23, 2003 i wish there was an "empty" constructor... public Surface (Device, Stream, Pool) public Surface (Device, Bitmap, Pool) public Surface (IntPtr, Object) those are my choices... i tried using the IntPtr one passing in IntPtr.Zero but then it just throws an object disposed exception when i call SurfaceLoader from stream... so i guess i have to use the stream constructor to create the surface then seek the stream back and then use SurfaceLoader to read the same stream into the same object to make the Color.Red transparent... it also seems to crash if i try to use Pool.Managed for my cursor... but i guess that is a whole other issue... anyone else use the SetCursorProperties in dx9 c#? how did you do it? Quote
Rakka Rage Posted May 25, 2003 Author Posted May 25, 2003 the bitmap constructor works!? :) thanks anyway Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.