Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Changing Alpha values in GDI+

Featured Replies

Hi,There are a lot of examples of how to change colors in a bmp in GDI+ and the Color class does contain a method to set a new value.However I have tried this many times and had no luck.Here is the algorithmByte Brightness = 0xFF; Color green(brightness, 0x00, 0xFF, 0x00);rendergauge{...Make argb (brigness, ....) --this is in the the sdkgreen.setvalue(argb);}Mousefunctionbrightdownbrightness--;Any ideas? Has anyone else managed to do this?Also has anyone been successful in making their own class defenitions and methods in FS9? Mine compiles and runs but once you press alt, FS9 exits.ThanksJon

I'm not at home at the moment, I'll have to check in detail later. The problem of exiting on "ALT" looks, as if you "hook" to the bitmap in the wrong time. You can't use PANEL_SERVICE_CONNECT_TO_WINDOW and PANEL_SERVICE_DISCONNECT for hooking to the MAKE_STATIC, since the pointers get invalid on resizing, these both service_ids are only for starting/stopping GDI+. You can either use all GDI+ drawing code in the PANE_SERVICE_PRE_DRAW or choose the the servide_ids for contructiing/destructing with care.Arne Bartels

Hi Arne,Im not sure what you mean by "hooking the bitmap" but I do have code in those to functions for things other then gdi+ (mainly for initialization destruction of my own class objects). Also it looks like my drawing functions are only being called once and not updating with time. They do resize approriatly when they need to but other then that, it looks like they are only being called once.Any ideas?Thanksjon

So are you just trying to change the alpha of a bitmap, before drawing it?If so, try using a colormatrix. I used something like this to turn my bitmap into an alpha shadow:ImageAttributes ia;ColorMatrix colorMatrix = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, .50f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};ia.SetColorMatrix(&colorMatrix, ColorMatrixFlagsDefault, ColorAdjustTypeBitmap);

Matt Kaprocki

Boeing777_Banner_DevTeam.jpg

For fastest support, please submit a ticket at http://support.precisionmanuals.com

No,I want to change the alpha value of a color for a pen. Not a bitmap.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.