Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted
can you just "New Surface(Device)" then use that in SurfaceLoader?
.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?
Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...