|
-
Oct 14th, 2001, 06:59 AM
#1
Thread Starter
Hyperactive Member
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.
-
Oct 14th, 2001, 07:41 AM
#2
I don't believe there is any replacement in Win95 for TransparentBlt.
-
Oct 14th, 2001, 12:16 PM
#3
Fanatic Member
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 
-
Oct 14th, 2001, 01:46 PM
#4
Frenzied Member
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.
-
Oct 14th, 2001, 01:50 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|