GM_SelectAreaStyle function
Hi Mike,
I have problem with the GM_SelectAreaStyle function. The final result of the label format is different from what it shows in the ‘Select Area Style’ window. The label did not rotate and the label background did not filled. And an error message displayed when I changed the fixed height of the label.
I have attached the screen shots for your reference.
Thanks for your help in advance.
Cheers
Dilys
I have problem with the GM_SelectAreaStyle function. The final result of the label format is different from what it shows in the ‘Select Area Style’ window. The label did not rotate and the label background did not filled. And an error message displayed when I changed the fixed height of the label.
I have attached the screen shots for your reference.
Thanks for your help in advance.
Cheers
Dilys
Comments
-
Dilys,
Can you try getting the latest SDK beta build from http://www.globalmapper.com/GlobalMapperSDK_v131_beta.zip and see if that works better. In the past label rotation was only for points, but in the latest code should work for area labels as well.
For your declarations, make sure that your enumerations of types are defined to the proper size (I can't see your declarations of things like GM_PenStyle_t16 to see if they are correct). Also, I would make the GM_FontDef_t a separate structure rather than embedding the members directly in your GM_AreaStyle_t structure as that may cause problems with the alignment if it is different.
There are also a couple of problems in the font part of your declaration. The mFixedHgt value should be a single precision floating point (is that 'Single'?), not a 'Double'. Also, the latest SDK adds a new member to the GM_FontDef_t structure, so you'll want to add the following to the bottom of your definition:
Public mLabelPlacement As Byte
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Hi Mike,
Could you kindly let me know which part in the GM_FontDef_t or GM_AreaStyle_t structures is for font angle please?
// This type is used to describe a font used for rendering text
typedef struct
{
const char* mFaceName; // name of font face used
COLORREF mColor; // RGB color of font
uint16 mWeight; // weight of font (use Win32 constants, like FW_BOLD, FW_THIN, FW_NORMAL, etc.)
uint8 mPointSize; // font point size (set mFixedHgt value to non-zero to use fixed height)
boolean mItalicize; // draw text with italics?
boolean mUnderline; // underline text?
boolean mStrikeout; // strikeout text?
uint8 mCharset; // character set (use OEM_CHARSET for default behavior)
GM_FontBackground_t8 mBgMode; // background fill mode (i.e. opaque or transparent)
float mFixedHgt; // fixed height of font in meters (use 0.0 for normal point-size font)
GM_LabelPlacement_t8 mPlacement; // label placement relative to point features (only applies for point features)
} GM_FontDef_t;
// This type is used to describe a style used for drawing an area feature
// and its label (if any)
typedef struct
{
GM_PenStyle_t16 mBorderPenStyle; // border pen style (i.e. solid, dash, etc.)
uint16 mBorderPenWidth; // width to draw border pen in
COLORREF mBorderPenColor; // color to use for border pen
COLORREF mBrushColor; // color of brush to fill area with (when applicable to brush style). The color is defined as ARGB where the upper 8 bits are alpha. The exception is a value of 0 in the A is treated as no alpha.
GM_BrushStyle_t16 mBrushStyle; // style of brush to fill area with
boolean mDrawLabel; // render the label for this area if there is one
boolean mDrawLabelAlways; // render the label for this area even if it collides with another display label
GM_FontDef_t mFont; // font to use to render label
} GM_AreaStyle_t;
Thanks
Dilys -
Dilys,
Now that I look at this it appears that the GM_FontDef_t structure doesn't store the rotation, which is likely why it is being lost! I'll add that and get you a new build of the SDK.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Dilys,
I have completed adding a new mAngle floating point member to the GM_FontDef_t structure to represent the rotation angle. I have placed a new build of the SDK with this change at http://www.globalmapper.com/GlobalMapperSDK_v131_beta.zip for you to try.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Hi Mike,
It works now.
Thanks
Dilys
Categories
- 12.9K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 645 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
- 575 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 242 How I use Global Mapper
- 108 Global Mapper Forum Website