473,394 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Setting the muse cursor image from a bitmap

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==]
Dec 15 '05 #1
2 1830
Oh, yeah, almost forgot:

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

[==P==]

"Peteroid" <pe************@msn.com> wrote in message
news:e2**************@TK2MSFTNGP12.phx.gbl...
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==]

Dec 15 '05 #2
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" <pe************@msn.com> wrote in message
news:OC*************@TK2MSFTNGP09.phx.gbl...
Oh, yeah, almost forgot:

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

[==P==]

"Peteroid" <pe************@msn.com> wrote in message
news:e2**************@TK2MSFTNGP12.phx.gbl...
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==]


Dec 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: TomHL | last post by:
hello, - I have a Bitmap Object named: bmp1 - I already have the numerical values of:red,blue and green colors + I have the X and Y cordinates. How do I set the pixel value via safe code on...
16
by: Niels Jensen | last post by:
I have been developing a little project which draw's a hexgrid on a panel within a form similar to this - it:s used as a client from a e-mail based strategy game: ____ ____ / \...
6
by: Dennis | last post by:
Can I create a cusor in vb.net code from a bitmap? -- Dennis in Houston
4
by: John Swan | last post by:
Hello. I'm trying to create a simple program that amongst other things creates a thumbnail of an image (Bitmap) to a set size determined by the user in pixels? The problem is: All of the...
2
by: Wilfried Mestdagh | last post by:
Hi, I create a new cursor like this: Bitmap bmp = new Bitmap(fileName); panel1.Cursor = new Cursor(bmp.GetHicon()); But now I want to embed the image in the executable. I have already add...
2
by: Tom C | last post by:
I see a lot of posts about creating a cursor from an image but is it possible to do the opposite? We have added code to allow a text box on a statusbar to be dragged to allow dropping an open...
1
by: pbernasc | last post by:
Does anyone know how to successfully load a custom color (32 bits) cursor in C# (under XP..NET 2.0 - or NET3.0 eventually)? All I could do using C# .Net support was loading a color cursor but ending...
2
by: swetha | last post by:
Hi, I am loading one bitmap file.I can able to find out the mouse cursor position values on that image.But after zooming also the values should not change.Is there any sollution for that. Hope...
2
by: ACS | last post by:
I have a C# application where I've grabbed a control's cursor handle using the WINAPI function GetCursor(). This returned an IntPtr and I want to check what type of cursor this is (arrow, sizing,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.