How to make an area transparent ?

mg.srikanth
Global Mapper User
Hi,
How do I apply transparency to a layer/feature on the map display using sdk?
Or how do I draw a translucent area feature?
Srikanth
How do I apply transparency to a layer/feature on the map display using sdk?
Or how do I draw a translucent area feature?
Srikanth
Comments
-
For raster layers use GM_SetRasterDisplayOptions to set a particular color transparent for a raster layer or to make the layer translucent.
For area features, use GM_SetAreaFeatureDrawStyle. The color is a 4-byte value and you can use the upper byte for an alpha value for translucency if you use GM_BRUSH_SOLID as the fill style.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Hi Mike,
I used GM_SetAreaFeatureDrawStyle but the color is taking RGB only how to specify ARGB value? I tried assigning (A,R,G,B) values but did not work for me, how to specify alpha value for a color, can u provide a sample syntax for it?
Thanks
Srikanth. -
It is just the upper 8 bits of the value. So just setup the 24-bit color that you want, then add the alpha left shifted by 24-bits to put it in the top. For example, to setup red with an alpha of 200, do the following:
uint8 theAlpha = 200;
theAreaStyle.mBrushColor = COLORREF( 255, 0, 0 ) + ( theAlpha << 24 );
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Thank you Mike,
COLORREF( 255, 0, 0 ) + ( theAlpha << 24 ); - did not work for me but the following worked
RGB( 255, 0, 0 ) + ( theAlpha << 24 );
Thanks Mike
Categories
- 12.9K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 643 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 419 Projection Questions
- 829 Raster Data
- 1.4K Vector Data
- 6.6K Support
- 180 Announcement and News
- 926 Bug Report
- 561 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 574 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 241 How I use Global Mapper
- 108 Global Mapper Forum Website