Can someone give me a simple example of how to make transparent drawings with Ddraw ??
Printable View
Can someone give me a simple example of how to make transparent drawings with Ddraw ??
Semi- or Fully- transparent? If it's fully-transparent then you must specify a colour key. If it's semi- then you must either use vbDabl or something else...
Um, what's the difference =D
If you have a transparent colour you want to see through (eg. true purple, 255,0,255) you want FULL transparency. If you have your picture and you want to make all of it a bit see through you are looking for semi-transparency.
K, so how do you do full transparency?
Dim ddColourKey As DDCOLORKEY
ddColourKey.Low = RGB(255,0,255)
ddColourKey.High = RGB(255,0,255)
DirectDrawSurface7.SetColorKey ddColourKey
thanks ^^ One more thing; is there any particular advantage to using one method over the other? Which one is better?
Well, one is not a replacement for the other, (it could be but you would experience speed hits) you could even use both together. For example, using the partial transparency means BLENDING. This takes the one colour, adds a bit to it, and takes the other colour and adds a bit of it too. You can make it different percentages (eg. 80% of image, 20% of background, etc.) and using the two together you could make a semi-transparent irregular region (for example, a character that is a ghost). There is another way, using alpha maps, (each pixel has different "alpha" percentages [explained above]) but it is slower.
I have never formed a practical example of the 2nd or 3rd transparency things, but the first is easy to do.