PDA

View Full Version : how to make a specific image color transparent?



mmunzel
11-22-2011, 01:14 AM
hi,

im a little bit confused about blending images at ovg.

I have to do something like this:

if ( imagepixel == RGB(A) ) set alpha of imagepixel = 0 ( transparent )

I have implement this with GDI. How to do this ovg?

Is there a way to do this without modify the image buffer of vgimage ?

thanks.

Ivo Moravec
11-22-2011, 01:28 PM
Well, you will need to tell OVG which pixels are transparent. This means that you will need to set the alpha value (aka transparency) in the image. You can either do this yourself by modifying the image buffer before you give OVG the image. It should be possible to come up with some way of using vgLookUp, vgLookUpSingle, vgColorMatrix, and/or VG_COLOR_TRANSFORM to accomplish the same effect, but honestly... why?

mmunzel
11-23-2011, 04:30 AM
well i have a UI Controls library witch have an DeviceContext that use GDI to render the controls and to be compatiblee with it i have to implement this functionality.
Under wince there is a function called TransparentBLT wich have the same functionality.

i have played a litte bit with color transform etc. but at the moment i am only able to give the hole image a alpha/ transparency.

Can you give me an example how to do it to make a specific color transparent?