Any one knows how to use "SetCursorProperties"?

Dipucian

New member
Joined
Aug 23, 2004
Messages
4
Location
Hong Kong
Hi all! My first post here[Broken External Image]:http://www.computerhelp.forum/images/smilies/tongue.gif

I want to make a custom cursor for my game, I searched the msdn and found three functions which I think will make it happen. But I failed...[Broken External Image]:http://www.computerhelp.forum/images/smilies/redface.gif

The three functions are SetCursorProperties, ShowCursor and SetCursorPosition of the Direct3D Device class. Experts here please help...

My code are as follows:
Code:
public void Init()
{
PresentParameters presParameters = new PresentParameters();
presParameters.BackBufferCount = 1;
presParameters.Windowed = true;
presParameters.SwapEffect = SwapEffect.Discard;
graphicCard = new Device(0, DeviceType.Hardware, target,
	CreateFlags.HardwareVertexProcessing,
	presParameters);
System.Drawing.Bitmap bm = new System.Drawing.Bitmap(@"..\..\head.gif");
Surface s = Surface.FromBitmap(graphicCard, bm, Pool.SystemMemory);
graphicCard.SetCursorProperties(0, 0, s);
graphicCard.ShowCursor(true);
graphicCard.SetCursorPosition(0, 0, true);
}
 
Thanks for your help!
But I have tried to change my code (last 5 lines) to:
C#:
Cursor c = new Cursor(@"..\..\head.gif");
graphicCard.SetCursor(c, true);
and it said the function only takes .cur files, how to get one from .gif?
Ive tried the public Cursor(Type, string); overload, but dont work also...
 
Back
Top