Results 1 to 5 of 5

Thread: BitBlt - how to make transparent pictures...

  1. #1

    Thread Starter
    Hyperactive Member FLasH3r's Avatar
    Join Date
    Feb 2001
    Location
    Bad command or filename
    Posts
    259

    Question BitBlt - how to make transparent pictures...

    I am making an RPG game and i need to know how to make transparent pictures for the actors.
    the problem is, the API to do that uses a dll only in win98.
    i need code to replace that API to make it compatible to win95.

    the API name is: TransparentBlt
    the API is from the file: msimg32.dll

    thanks in advanced.

  2. #2
    Tygur
    Guest
    I don't believe there is any replacement in Win95 for TransparentBlt.

  3. #3
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    The only way I know how to do that (which is the way it was done before that function appeared) was through the use of sprites and masks. You'd copy the section of the background where you want to do this to someplace (which is optional since you can just put the mask/sprite combo directly on the background), use the ROP SrcAnd to place a black and white mask image down (it's white in the background, and black wherever there is a color in the real image), and then you'd use the ROP SrcPaint to put in the sprite, which is an image that is black in the background, and has the real colors of the rest of the image. What the mask does is blot out a region of the background in black where the image itself will go, leaving the white areas the same since any color And'ed with white produces the color. The sprite then uses Or to combine the real colors with that black spot since any color Or'ed with black produces the color. Then the working image is copied to the background.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  4. #4
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    This link points to an example I wrote for doing transparent bitblts using Bitmpas and API calls which will work on all versions of windows. To be honest I don't know if this will be fast enough for a game with a lot of graphics but it may help.

    http://freevbcode.com/ShowCode.Asp?ID=2337

    Greg
    Free VB Add-In - The Reference Librarian
    Click Here for screen shot and download link.

  5. #5
    DaoK
    Guest
    What I do not understand of that exemple is than when you select to have a tranparent background and you select move it's not transparence.

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