473,322 Members | 1,421 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,322 software developers and data experts.

Cursor from BitMap

Can I create a cusor in vb.net code from a bitmap?
--
Dennis in Houston
Nov 21 '05 #1
6 6958
"Dennis" <De****@discussions.microsoft.com> schrieb:
Can I create a cusor in vb.net code from a bitmap?


See (complete thread):

<URL:http://www.google.de/groups?theadm=Pstdd.92876%24ct3.2218732%40wagner.v ideotron.net>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
Does Herfried support a link that interest me, does it not work.

:-)

Cor
Nov 21 '05 #3
Hi,

You can create a bitmap then create the cursor from the bitmap.
Dim bmCur As New Bitmap(60, 60)

Dim g As Graphics = Graphics.FromImage(bmCur)

g.FillRectangle(Brushes.Transparent, 0, 0, 60, 60)

g.DrawEllipse(Pens.Red, 10, 10, 40, 40)

g.DrawEllipse(Pens.Red, 0, 0, 60, 60)

g.DrawEllipse(Pens.Red, 30, 30, 1, 1)

g.DrawEllipse(Pens.Red, 25, 25, 10, 10)

Dim ptrCur As IntPtr = bmCur.GetHicon

Dim cur As Cursor

cur = New Cursor(ptrCur)

Me.Cursor = cur

Ken

-----------
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Can I create a cusor in vb.net code from a bitmap?
--
Dennis in Houston
Nov 21 '05 #4
"Cor Ligthert" <no************@planet.nl> schrieb:
Does Herfried support a link that interest me, does it not work.


I made a typo ("theadm" instead of "threadm"):

<URL:http://www.google.de/groups?threadm=Pstdd.92876%24ct3.2218732%40wagner. videotron.net>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5
Herfried,

Sorry I remembered me this one again it is from Ken I took it already in my
HKW brainconnector replacer.

:-)

Cor
Nov 21 '05 #6
That works great. Thanks a lot.

"Ken Tucker [MVP]" wrote:
Hi,

You can create a bitmap then create the cursor from the bitmap.
Dim bmCur As New Bitmap(60, 60)

Dim g As Graphics = Graphics.FromImage(bmCur)

g.FillRectangle(Brushes.Transparent, 0, 0, 60, 60)

g.DrawEllipse(Pens.Red, 10, 10, 40, 40)

g.DrawEllipse(Pens.Red, 0, 0, 60, 60)

g.DrawEllipse(Pens.Red, 30, 30, 1, 1)

g.DrawEllipse(Pens.Red, 25, 25, 10, 10)

Dim ptrCur As IntPtr = bmCur.GetHicon

Dim cur As Cursor

cur = New Cursor(ptrCur)

Me.Cursor = cur

Ken

-----------
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Can I create a cusor in vb.net code from a bitmap?
--
Dennis in Houston

Nov 21 '05 #7

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

Similar topics

1
by: Tim | last post by:
Hi, I would like to create a custom mouse cursor for my print preview page. I want to use a bitmap of a magnifiying glass with a plus in it. Pretty standard stuff. How do I change the cursor?...
0
by: Sam | last post by:
Hello all Could anyone please tell me if I can attach a transparent bit map to positions of the cursor without actually replacing the cursor? The bitmap would move with cursor. For example if I...
2
by: Peteroid | last post by:
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...
0
by: Richard Lewis Haggard | last post by:
In an attempt to get around a resource leak issue, I tried to serialize a Cursor to a MemoryStream but the serialization fails with "Stock cursors cannot be serialized." This is puzzling since 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:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.