Setting the muse cursor image from a bitmap

P

Peteroid

This seems like it should be an easy task, but I just can't find the info on
it. MSDN2 shows an example where the cursor is changed to the system default
Cursors::Hand, but not how to make a custom one from a bitmap.

I have in memory a 16x16 bitmap. I want to make that the mouse cursor image
over a Panel I have.

Now, I know this part:

panel->Cursor = gcnew_cursor ;

And I know the Cursor class allows the creation using different
constructors. Problem is none of them use a bitmap.

I assume there is a way to do this. Also, as long as I'm trying to make a
custom cursor, an I restricted to 16x16 size? And if I can use a bitmap,
will it recognize the transparent color I set for the bitmap?

Thanks for responses!

[==P==]
 
P

Peteroid

Oh, yeah, almost forgot:

VS C++.NET 2005 Express using clr:/pure syntax...

[==P==]
 
P

Peter Oliphant

AHA! Ran into my first reason to want to upgrade from Express. Apparently
one can't create resources such a cursor (.cur) files with Express, but can
with PRO.

I menton this in this thread becuase this helps my problem with creating
custom mouse cursors. But I'd still like to know how to use a custom bitmap
I construct at run time in memory and use it as a mouse cursor image...

[==P==]

Peteroid said:
Oh, yeah, almost forgot:

VS C++.NET 2005 Express using clr:/pure syntax...

[==P==]

Peteroid said:
This seems like it should be an easy task, but I just can't find the info
on it. MSDN2 shows an example where the cursor is changed to the system
default Cursors::Hand, but not how to make a custom one from a bitmap.

I have in memory a 16x16 bitmap. I want to make that the mouse cursor
image over a Panel I have.

Now, I know this part:

panel->Cursor = gcnew_cursor ;

And I know the Cursor class allows the creation using different
constructors. Problem is none of them use a bitmap.

I assume there is a way to do this. Also, as long as I'm trying to make a
custom cursor, an I restricted to 16x16 size? And if I can use a bitmap,
will it recognize the transparent color I set for the bitmap?

Thanks for responses!

[==P==]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top