Shared Samples

Try out source code samples stored in Bitbucket repositories.
Showing results for 
Search instead for 
Do you mean 

Job writemdf: how to convert .img to non-img format

by Technical Evangelist on ‎09-08-2015 10:45 AM - edited on ‎03-29-2016 11:35 AM by Anonymous (842 Views)

Example Type






This example shows how to write a program that convert img to mdf(non-img raster file). The mdf file(my data format) is not related to any known "standard" format.




writemdf.c                   (C source code)

writemdf.eml   (EML script)

writemdf.dsp   (Visual C++ Project)(Windows Only)





The source code in this file provides the required Functions for an executable that writes a BSQ image file containing 12 header bytes. And binary pixel data to an IMG file. The header bytes represent 3 values; the number of image bands the number of rows, and the number of columns.



Command Line Options


writemdf -in <inputfile> -out <outputfile> -m <1 or 0> -h <1 or 0>



 The input .img file name.



 The output .mdf file name.



 with meter bar.



 generate header file (include pixel depth, Pixel Coordinate...)








The output are mdf image and mdh header file (optional)


Source Code