Global Mapper Pro Coming Soon

GM_DrawLayerListToMemory failing

kaldenkalden Global Mapper UserPosts: 41
edited June 2009 in SDK
Hello,

I am using GM_DrawLayerListToMemory and am running into issues with large textures. The texture is a single 7960x8192 layer in the failure case. The function returns error code 6 and I can't figure out why.

Smaller textures work, but even then I have to call this function twice to get it to succeed.

Any advice would be greatly appreciated.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2009
    Are you getting any kind of error message, perhaps going to a function set by your GM_SetMessageCallback call (if you used it)? For the large textures I'm guessing the issue is memory. Your in-memory buffer is likely around 200-250 MB (depending on if it is a 24-bit or 32-bit buffer). Additionally within the SDK Global Mapper will render to an offscreen bitmap that will be a full 24-bit image, so an additional 200 MB or so is needed, along with whatever other memory is used. You are likely running out of Windows resource memory.

    I might suggest breaking up large textures into smaller chunks (say 4096 x 4096) and rendering them into your large buffer. Just adjust the row width and offset your pointer so that everything still gets written to the right place in your buffer.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.