- Messages
- 65
- Country

Hi folks. You guys are always wonderful and have helped me out a lot in the past. Here's my current issue:
I'm designing my first GDI+ gauge, it's a gunsight. For now, it's on a 2D panel.
I followed pretty closely the Microsoft sample code for the "transparent gauge." So far so good, I draw the objects that I need, and when I vary transparency through the KEY_VIEW_PANEL_ALPHA_SET it works perfectly, from fully opaque to fully transparent, eventually disappearing altogether.
The problem is this:
I should very much like to vary the transparency of the various GDI+ objects directly, ie through their respective brushes and pens. But when I vary the alpha value of a brush, the result is not what I would expect:
The actual transparency of the object does not change at all, it remains at exactly the value set through KEY_VIEW_PANEL_ALPHA_SET, but as I decrease the brush alpha, the object's color changes from white (the brush color) to a dark gray, and then abruptly disappears at 50% alpha (128) and is entirely invisible at any value which is below this.
Am I describing a familiar problem? My assumption is that FSX would like the brush alpha channel to be in a different format than what the brush is providing... Is it something that is fixable? I would ever so much appreciate any sort of guidance.
Hopefully,
Farley
P.S. My "MAKE_STATIC" code appears below, on the off-chance that it is significant. I am using the background bitmap from the Microsoft sample gauge.
MAKE_STATIC(migDummybackground,BMP_BACKGROUND, NULL, NULL, IMAGE_CREATE_DIBSECTION | IMAGE_USE_TRANSPARENCY | IMAGE_USE_ALPHA | IMAGE_USE_ERASE | IMAGE_ERASE_ALWAYS, 0, 0, 0)
I'm designing my first GDI+ gauge, it's a gunsight. For now, it's on a 2D panel.
I followed pretty closely the Microsoft sample code for the "transparent gauge." So far so good, I draw the objects that I need, and when I vary transparency through the KEY_VIEW_PANEL_ALPHA_SET it works perfectly, from fully opaque to fully transparent, eventually disappearing altogether.
The problem is this:
I should very much like to vary the transparency of the various GDI+ objects directly, ie through their respective brushes and pens. But when I vary the alpha value of a brush, the result is not what I would expect:
The actual transparency of the object does not change at all, it remains at exactly the value set through KEY_VIEW_PANEL_ALPHA_SET, but as I decrease the brush alpha, the object's color changes from white (the brush color) to a dark gray, and then abruptly disappears at 50% alpha (128) and is entirely invisible at any value which is below this.
Am I describing a familiar problem? My assumption is that FSX would like the brush alpha channel to be in a different format than what the brush is providing... Is it something that is fixable? I would ever so much appreciate any sort of guidance.
Hopefully,
Farley
P.S. My "MAKE_STATIC" code appears below, on the off-chance that it is significant. I am using the background bitmap from the Microsoft sample gauge.
MAKE_STATIC(migDummybackground,BMP_BACKGROUND, NULL, NULL, IMAGE_CREATE_DIBSECTION | IMAGE_USE_TRANSPARENCY | IMAGE_USE_ALPHA | IMAGE_USE_ERASE | IMAGE_ERASE_ALWAYS, 0, 0, 0)


. So it's got a long way to go. The application GUI and the airplane config file setup are extremely buggy, and I only have a couple of very basic xml gauges to control the radios. I mainly fly the A2A warbirds, which have decent animated models of appropriate radios in the VC, so I can hijack their knobs and such. The physics side of it has been fun to develop too, the algorithms currently factor in Tx power, Rx sensitivity and tuning, wavelength, range, altitude, atmospheric conditions, time of day/ionosphere, polarization and directional gain of the two antennae, and of course everything is suitably dithered and randomized. In addition, within the receiver side of it there's some fun stuff, for instance a heterodyne mixer which factors in all the different received RF signals and produces the appropriate difference tones when they are within the audible range (This is how simultaneous range/voice stations worked, the range towers transmitted unmodulated on the published freq minus 1020hz, effectively creating a SSB tone modulation in the receiver when combined with the central tower which transmitted on the published frequency with AM voice modulation. I really think it's utterly fascinating!). So the BFO is implemented in the receiver simply by injecting its frequency into the mixer. Admittedly, the BFO doesn't sound great yet - because the tuning knob moves in small jumps, the BFO tone jumps immediately to a different pitch, rather than changing smoothly. I have yet to find a way to work around that.