Global Mapper v25.0

Background Color issues in 64bit dll

nickgoodliff
nickgoodliff Global Mapper UserTrusted User
edited May 2013 in SDK
Hi Mike

A weird one - I'm just testing a 64bit version of my tool, which uses the 64bit dll. All works fine except the background color that I am setting like this:

GM_Color_t white = new GM_Color_t();
white.mBlue = 255;
white.mRed = 255;
white.mGreen = 255;
GlobalMapperDLL.GM_SetBackgroundColor(white);

In the 64bit version the background color of any outputted jpgs is a pale green, instead of the white that the 32bit produces. Any ideas?

Cheers
Nick

Comments

  • global_mapper
    global_mapper Administrator
    edited May 2013
    Nick,

    The GM_SetBackgroundColor function takes a COLORREF and not a GM_Color_t structure. It could be that in 32-bit the GM_Color_t structure happens to have the same layout as COLORREF. In C# the declaration should be:

    // Sets the color to be used for background pixels when drawing and exporting
    [DllImport(DLLFileName, EntryPoint = "GM_SetBackgroundColor")]
    public static extern UInt32 GM_SetBackgroundColor
    (
    UInt32 aBgColor // (COLORREF) in: background color to set (AARRGGBB)
    );

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation