- Messages
- 823
- Country
Is it possible to draw a gradated ( or graduated? ) 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?
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
)