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

Cursor from BitMap

P: n/a
Can I create a cusor in vb.net code from a bitmap?
--
Dennis in Houston
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"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

P: n/a
Does Herfried support a link that interest me, does it not work.

:-)

Cor
Nov 21 '05 #3

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.