PC Review


Reply
Thread Tools Rate Thread

vb.net crosshair cursor...

 
 
Pj
Guest
Posts: n/a
 
      7th Apr 2005
hi,

i have the following code for drawing a crosshair cursor & it works:

'Custom cursor
'Declare bitmap
Dim bm As New Bitmap(64, 64)
'Declare graphics
Dim g As Graphics = Graphics.FromImage(bm)
'Clear the graphics
g.Clear(Color.Transparent)
'Declare cursor pen and set colr + width
Dim myCursorPen As Pen = New Pen(Color.White, 2)
'Draw cross hair
g.DrawLine(myCursorPen, 32, 0, 32, 64)
g.DrawLine(myCursorPen, 0, 32, 64, 32)
'Dispose the graphics
g.Dispose()
'Declare a cursor object
Dim cur As New Cursor(bm.GetHicon)
'Set the cursor object
Me.Cursor = cur

the problem is that its 64*64 and i cannot increase it. how can make
it to 500*500?? if i try it does not work!

any ideas?

thanks
pj
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      7th Apr 2005
"Pj" <(E-Mail Removed)> schrieb:
> i have the following code for drawing a crosshair cursor & it works:
>[...]
> the problem is that its 64*64 and i cannot increase it. how can make
> it to 500*500?? if i try it does not work!


Instead of using a cursor, hide the cursor and draw the crosshair on the
desired position onto the form/control.

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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a simple crosshair in VB.Net nick haddad via DotNetMonster.com Microsoft VB .NET 2 16th Jan 2005 07:28 PM
Crosshair on-top of webcam video or an Overlay Crosshair Henry Wu Microsoft VB .NET 1 17th Jun 2004 03:41 PM
crosshair cursor problem Windows XP Internet Explorer 0 27th Jan 2004 03:32 PM
Hidden and Dangerous 2 - No Crosshair on rifle ?? Jim N Windows XP Games 1 30th Oct 2003 08:14 PM
Query result with crosshair to show more details from another table/query Myr Microsoft Access Queries 0 30th Sep 2003 02:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:32 PM.