Results 1 to 7 of 7

Thread: Mouse cursor as gif

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    11

    Post

    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

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    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

  3. #3
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    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
    www.cintelsoftware.co.uk

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    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).]

  5. #5
    Registered User
    Join Date
    Jan 2000
    Location
    Otanmäki, Finland
    Posts
    7

    Post

    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

  6. #6
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    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
    www.cintelsoftware.co.uk

  7. #7
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width