• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Blitting Semi-Transparent

## Recommended Posts

Scooter    109
How do i blit a bitmap semi-transparently?

##### Share on other sites
A. Buza    122
I'm not sure if DD 8.0 supports it, but do a search for translucency or alpha-blending. You can do it manually too.. just take each pixel and do something like this:

ForegroundPixel + BackgroundPixel /2 = NewPixel

(obviously doing that for the RG&B components seperately)

The above will give you 50% tranlucency. I had the formula for variable translucency somewhere, but I lost it when formated one of my hard drives. From what I remember, you take each color value and multiply it by a %. 1.0 for opaque, 0.0 for invisible, 0.5 for half-way, etc..

Edited by - A. Buza on October 3, 2000 7:13:24 PM

##### Share on other sites
MButchers    123
Hi there,

I use the following

  #define BLEND(src,dest,alpha) (((alpha*(src-dest))>>8)+dest)#define BLEND50(src,dest,alpha) ((src+dest)*0.5)

Hope it helps.

Edited by - MButchers on October 4, 2000 6:35:16 AM

##### Share on other sites
Scooter    109
So each frame, i''d have to get the dest. r,g,b and do the blend with the source r,g,b colors individually? doesn''t this eat up alot of time?