Convert CGM to Image SDK
Our Convert CGM to Image SDK provides a "seamless" format conversion process for applications that need to import drawings, maps, logs, and seismic.
Convert CGM SDK accurately converts ISO CGM V1-V4 files to raster formats: BMP, GIF, JPEG, PDF, PNG, and TIFF. Program controls for compression, bits per pixel, scaling, gamma, resolution (dpi) and rotation are included to facilitate desired output.
Fast Implemetation; Simply, setup the conversion parameters and then call a single function which converts the CGM file to your target format.
Convert CGM SDK includes sample code and the converter library (DLL), which can be utilized with your C, C++ or C# applications.
Example Code (C++):
CGM2IMG_PARAMS params;
long result;
char CgmName[] = { "allelm01.cgm"};
char FontDir[] = { "." };
char WorkDir[] = { "." };
char OutFile[] = { "allelm01.tif"};
memset(¶ms, 0, sizeof(CGM2IMG_PARAMS));
params.fmt = CGM2IMG_TIF;
params.bppi = CGM2IMG_1_BPP; // 1 bit per pixel;
params.comptype[0] = 4; // group 4 compression type
params.comptype[1] = 0; // compression option
params.imgsize[0] = 1000; // width
params.imgsize[1] = 1000; // height
params.units = CGM2IMG_PIXELS; // Units determines how the values set
// for imgsize are interpreted.
params.dpi = 75;
params.gamma = (float)100;
params.picture = 1;
params.rotation = 0;
params.media = CGM2IMG_DEFAULT_BG;
params.logfile = NULL;
params.bMonoEnhance = 2;
result = cgm2img_api(CgmName, OutputFile, FontDir, WorkDir, ¶ms);
if (result)
MessageBox("Conversion Error");
Platforms: Windows XP, Vista, 7, 8 and 10; 32 and 64 bit; Linux 32 and 64 bit
Input: CGM V1-V4, CGM+
Output: BMP, JPEG, PNG, PDF (raster), TIFF
Profiles: ATA, PIP, S1000D, and WebCGM