FSX:SE GDI+ gauge drawing - gradated alpha transparency

#1
Is it possible to draw a gradated ( or graduated? :scratchch ) alpha transparency for virtual cockpit? I can draw a a transparent (HUD type) gauge no problem, but this consists of only 2 states: transparent or opaque.

I'd like to draw a smooth ramp from, let's say, black to transparent, using GDI+ calls. When I implemented that, I got full transparency for any alpha except full opaque. Same with bitmaps - I used a PNG with smooth transition from black to transparent, and I got full opaque to full transparent.

Let me make this clear: I can do these transitions when drawing onto a bitmap surface that is used as a gauge surface (for instance, a MFD screen). In this case, gauge surface is first cleared with black color. But when clearing with transparent color, as in the transparent gauge type, I only get either full opaque or full transparent.

I toyed with the material settings but so far nothing worked. I'm also wondering if any of the flags in MAKE_STATIC macro are used for this?

Code:
MAKE_STATIC
(
    SH_image,
    BMP_BACKGROUND,
    NULL,
    NULL,
    IMAGE_CREATE_DIBSECTION | IMAGE_USE_TRANSPARENCY | IMAGE_USE_ALPHA | IMAGE_USE_ERASE | IMAGE_ERASE_ALWAYS,
    0,
    0, 0
)
 

JB3DG

Resource contributor
#2
Unfortunately the sim insists on converting VC textures to 16bit which means only 1bit alpha. If you want a translucent HUD for example, your 3D model materials are the determining factor. I would set the blend mode to SrcColor/InvSrcColor. Then setting the alpha of your pens/brushes will blend the elements with a black background, which will reduce their actual RGB values, and then the sim will blend by color to get the final result.
 
Top