-
I'm writing a game which has to do with hunting. What I want to try to do is make the mouse pointer a crosshair, but the thing is that the crosshair I want is a .gif file.
Is there any way to make the mouse icon/pointer use that .gif file, so that when I click on my target, it uses the center of the image as the spot where the mouse would point, and either hits or misses the target.
I hope I described it enough for someone to help me out.
Thanks
-BLiNDPiG
-
Well, I wouldn't try to take a gif for your cursor, there are better ways to draw 1Bit transparency...
I don't know which method you're using to draw your game, so I'll show you how I did it:
First create an invisible picture box with [AutoRedraw = true] and [BorderStyle = 0].
Take your cursor and create the mask picture (That's why the gifs are useless, you dont use their transparency). U can use my program if you don't know why, just send me a mail.
Load the cursor into the box.
Then u can use for example BitBlt (API) to draw the cursor, first the mask (vbSrcPaint) and then the cursor (vbSrcAnd).
Hope you'll understand this, ask me for more help.
------------------
Fox
-
or just convert your gif into a .ico file using an icon program?
if u still wanted to use Fox's method
, i'd load the image into an off screen DC - theres no point in having a picbox using up memory :)
------------------
cintel rules :p
www.cintelsoftware.co.uk
-
Eh Kenny,
that's something I didn't know ;) How can I save a DC offscreen? I tried to make Pictureboxes using something like this: DC(0) = new PictureBox etc. But it didn't work.
Is there an API call or somthing to do that?
------------------
Fox
[email protected]
[No homepage yet]
[This message has been edited by Fox (edited 01-11-2000).]
-
Why not just to get Microangelo and draw 256 color icon and rename it to .cur? Much easier and it works.
In microangelo, it is possible to make even 50x50 icons or whatever you want.
Hopefully this is usefull for others, too. I'm not sure does this work, but I can try myself if you want to.
Vesa Piittinen
-
fox,
yes there is many api calls :)
look on vbexplorer.com - go to tutorials and find the GDI one.. it shows you how to load a bmp file into a DC.
now i'm using DX7, because its actually simpler than GDI.. and faster :)
------------------
cintel rules :p
www.cintelsoftware.co.uk
-
OK, thank you for the url, will help me alot.
Using DX in VB is fast, but in C it's faster ;)
I don't code DX apps in VB because of missing all the usefull things like pointers (-> linked lists) and some lines of asm...
------------------
Fox
[email protected]
...
Every program can be reduced to one instruction which doesn't work.