Results 1 to 10 of 10

Thread: Transparencies/Bitblt - Can someone explain it to me --- PLEASE

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    Colorado
    Posts
    11

    Angry Transparencies/Bitblt - Can someone explain it to me --- PLEASE

    I know this has probably been asked and answered a hundred times but I'm definitely an ameteur at this stuff and I don't quite understqnd it all. I've written a game in which a small picturebox moves around a form over a number of other larger pictureboxes. I'm currently doing the movement with simple adjustments of the Top and Left properties of the thing. The smaller picturebox contains a simple black circle with a white background at the corners. Of course I would like the white corners of the picturebox to be transparent. Can someone please tell me how to do this in simple, easy-to-understand terms? PLEASE?

    "Stuff is stuff."

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    http://vbden.tripod.com/articles/invmask.htm

    This is my BitBlt tutorial.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

  4. #4
    Megatron
    Guest
    You could also use the TransparentBlt function to draw a picture, and make any color transparent, thus eliminating the need for masks.

  5. #5
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    I think using TransparentBlt will restrict you to Win98 and above only

  6. #6
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    ...you could also use DDraw

    btw: In the games where I use BitBlt I generate the masks when starting the program, so there's no memory wasted in the bitmap files..

  7. #7
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Hey hey, wait, he's using picture boxes, so he doesn't need BitBlt

    All you need to do is use an image control (not a picture box). If the file you choose is a GIF file with transparency, the image control will be transparent like you want! I think that Paintbrush can save GIF files, but if it doesn't, you'll need another graphics program.
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  8. #8
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    GIFs are crap, years ago I tried the same but they're very slow... you can see how first a black mask is drawn, then the picture over this mask if you try to do anything with the picture..

  9. #9
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    But his game is not BitBlt based, it's based on pictureboxes (by setting their Top/Left borders). So he can't use BitBlt
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  10. #10

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    Colorado
    Posts
    11
    While I did state that I was using pictureboxes, I'm not constraining myself to using them. I'm willing to learn the "right" way of doing things. Speed is not much of a consideration as my game is fairly slow-paced. Perhaps I should upload what I have so far and get a concensus on how I SHOULD be doing it... So, without further ado, here it is...
    Attached Files Attached Files
    "Stuff is stuff."

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