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
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website