Transparent Blitting in 16-bit
I''m having a bit of trouble doing a transparent blt in 16-bit colour. I save a bitmap with 16 million colours (ie 24-bit) in PSP 6 with a background colour of RGB(66,66,66).
Then I use a slight variation on DDLoadBitmap from ddutils.cpp to load it into a surface with the screen mode set to 16-bit. I then use a slight variation of DDSetColorKey with a value of RGB(66,66,66) but the back ground is still blitted. However if i use CLR_INVALID or RGB(69,69,69) for the parameter to DDSetColourKey it works fine. Does anyone know why it is RGB(69,69,69) that works and not RGB(66,66,66)?
I realise that the colour may change from conversion from 24 to 16-bit, but isn''t that what DDColourMatch is for?
When I say a slight variation, all i''ve done is copy the code into my own class and modified some of it, eg the surface variable.
No sense being pessimistic. It wouldn''t work anyway.
===========================There are 10 types of people in the world. Those that understand binary and those that don't.( My views in no way reflect the views of my employer. )
The first obvious problem is RGB()
Are you useing windows macro named RGB()
because that one has nothing to do with 16-bit colour, your going to have to write your own RGB16() and when you do you have to take into account that some video cards use 5-5-5-bit colour while others use 5-6-5-bit colour (more common)
Hope that points you in the right direction.
p.s. Its nice to see someone spell colour properly
Edited by - Atavist on 1/27/00 6:59:19 PM
Are you useing windows macro named RGB()
because that one has nothing to do with 16-bit colour, your going to have to write your own RGB16() and when you do you have to take into account that some video cards use 5-5-5-bit colour while others use 5-6-5-bit colour (more common)
Hope that points you in the right direction.
p.s. Its nice to see someone spell colour properly

Edited by - Atavist on 1/27/00 6:59:19 PM
Just because the church was wrong doesn't mean Galileo wasn't a heretic.It just means he was a heretic who was right.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement