globalmapper.ExportRasterFromBitmap(str aFilename, HBITMAP aBitmap, HDC aDC, GM_RasterExportFormat_t32 aFormat, GM_Rectangle_t aWorldBounds, GM_RasterExportFlags_t32 aFlags) GM_Error_t32[source]


This function requires a Handle to Device Context (HDC), which comes from the Windows GUI. An HDC for a window is easy to get in C++, but unobtainable in Python without relying on other modules. As such, you may be unable to use this and other functions which need an HDC as parameter; they are included in the Python SDK for Global Mapper primarily for consistency with the C++ version of the SDK and are not fully supported at current release.

Generates a new raster image from a bitmap handle. The new raster image will have the same number of pixels as the bitmap. The aFormat parameter specifies what image format to use for the new raster. If aWorldBounds is not None, the provided bounds will be used to fill in the spatial information for the new file, if supported by the new file format.

  • aFilename (str) – Name of new file to create

  • aBitmap (HBITMAP) – Handle to bitmap to export

  • aDC (HDC) – Handle to compatible device context

  • aFormat (GM_RasterExportFormat_t32) – Format to export

  • aWorldBounds (GM_Rectangle_t) – World bounds of bitmap or None for last drawn

  • aFlags (GM_RasterExportFlags_t32) – Export flags


Error Code

Return type