Any one knows how to use "SetCursorProperties"?

Dipucian

Newcomer
Joined
Aug 23, 2004
Messages
4
Location
Hong Kong
Hi all! My first post here
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...
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?
I've tried the public Cursor(Type, string); overload, but don't work also...
 
Back
Top