| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8.6 Export to file (Pure C)
These functions export current view to a graphic file. The filename fname should have appropriate extension. Parameter descr gives the short description of the picture. Just now the transparency in EPS files are not supported.
- C function:
voidmgl_write_png (HMGLgr,const char *fname,const char *descr) - C function:
voidmgl_write_png_solid (HMGLgr,const char *fname,const char *descr) Exports current frame to PNG file with transparent background. Parameter fname specifies the file name, descr adds description to file (can be
NULL).
- C function:
voidmgl_write_jpg (HMGLgr,const char *fname,const char *descr) Exports current frame to JPEG file with non-transparent background (usually white). Parameter fname specifies the file name, descr adds description to file (can be
NULL).
- C function:
voidmgl_write_bmp (HMGLgr,const char *fname,const char *descr) Exports current frame to BMP file. Parameter fname specifies the file name, descr adds description to file (can be
NULL). There is no compression used.
- C function:
voidmgl_write_eps (HMGLgr,const char *fname,const char *descr) Exports current frame to EPS file. The vector representation is used if possible. So it is not recommended for the export of large data plot. It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter fname specifies the file name, descr adds description to file (can be
NULL).
- C function:
voidmgl_write_svg (HMGLgr,const char *fname,const char *descr) Exports current frame to SVG (Scalable Vector Graphics) file. The vector representation is used. In difference of EPS format, SVG format support transparency that allows to correctly draw half-transparent plot (like SurfA(), Surf3A(), Cloud()). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter fname specifies the file name, descr adds description to file (default is file name).
- C function:
voidmgl_write_idtf (HMGLgr,const char *fname,const char *descr) Exports current frame to IDTF file. Later this file can be converted to U3D format. The vector representation is used. So, the output file may be too large for graphic of large data array (especially for surfaces). However, program has no internal limitations for size of output file. Parameter fname specifies the file name, descr adds description to file (default is file name).
- C function:
voidmgl_show_image (const char *viewer,intnowait) Displays the current picture using external program viewer for viewing. The function save the picture to temporary file and call viewer to display it. If nowait=
truethen the function return immediately (it will not wait while window will be closed).
- C function:
voidmgl_set_size (HMGLgr,intwidth,intheight) Sets size of picture in pixels. This function must be called before any other plotting because it completely remove picture contents.
- C function:
voidmgl_flush (HMGLgr) Flushes the plotting commands to frame. This function may be useful if one wants to remove array before the finishing of the plot (i.e. before calling
Finish()). Also call of this function separate the objects in mglGraphIDTF. Most of plots call this function internally.
- C function:
intmgl_get_width (HMGLgr) - C function:
intmgl_get_height (HMGLgr) Gets width or height of the image.
- C function:
const unsigned char *mgl_get_rgb (HMGLgr) Gets RGB bitmap of the current state of the image. Format of each element of bits is: {red, green, blue}. Number of elements is Width*Height. Position of element {i,j} is [3*i + 3*Width*j].
- C function:
const unsigned char *mgl_get_rgba (HMGLgr) Gets RGBA bitmap of the current state of the image. Format of each element of bits is: {red, green, blue, alpha}. Number of elements is Width*Height. Position of element {i,j} is [4*i + 4*Width*j].
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
