By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

creating a custom cursor

P: n/a

I'm trying to create a custom cursor with following code:

Bitmap bmp = new Bitmap(@"c:\1.png");
Graphics g = Graphics.FromImage(bmp);
Cursor cursor = new Cursor(bmp.GetHicon());
this.Cursor = cursor;

But I get the exception: "A graphic object cannot be created with an
indexed pixel format." I drawed the thing in black/with using Paint. I'm
not sure I understand what the 'indexed pixel format' is, but something
to do with Paint or do I use wrong code ?

rgds, Wilfried [MapPoint MVP]
Jan 26 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a

I just tryed with an *.ico file. Seems to work nice now. Sorry be to
fast asking questions :)

rgds, Wilfried [MapPoint MVP]
Jan 26 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.