|
GLG Toolkit, C / C++ API Library
Version 4.6
|
This group contains methods used for printing, generating PostScript output and saving images. More...
This group contains methods used for printing, generating PostScript output and saving images.
Functions | |
| GlgBoolean | ExportPostScript (char *filename="out.ps", double x=0., double y=0., double width=2000., double height=2000., GlgBoolean portrait=True, GlgBoolean stretch=True, GlgBoolean center=True) |
| Generates a PostScript output of the current state of the viewport's graphics. More... | |
| PlatformDependent | GenerateImage (char *resource_name=NULL, PlatformDependent image=NULL) |
| Creates and returns an image of the current state of the viewport's graphics. More... | |
| PlatformDependent | GenerateImageCustom (char *resource_name, PlatformDependent image, GlgLong x, GlgLong y, GlgLong width, GlgLong height, GlgLong gap) |
| Creates an image of the specified rectangular region of the viewport's graphics. More... | |
| void | OnDrawMetafile (CDC *print_dc) |
| Windows only: Provides MFC metafile output support. More... | |
| void | OnPrint (CDC *print_dc) |
| Windows only: Provides MFC printing support. More... | |
| GlgBoolean | Print (PlatformDependent print_context, double x=0., double y=0., double width=2000., double height=2000., GlgBoolean portrait=True, GlgBoolean stretch=True, GlgBoolean center=True) |
| GTK and Windows only: Generates printing output of the current state of the viewport's graphics. More... | |
| GlgBoolean | SaveImage (char *resource_name, char *filename, GlgImageFormat format=GLG_JPEG) |
| Generates a JPEG or PNG image of the current state of this viewport's graphics and saves it to a file. More... | |
| GlgBoolean | SaveImageCustom (char *resource_name, char *filename, GlgImageFormat format, GlgLong x, GlgLong y, GlgLong width, GlgLong height, GlgLong gap) |
| Generates a JPEG or PNG image of the specified rectangular region of the viewport's graphics and saves it to a file. More... | |
| GlgBoolean ExportPostScript | ( | char * | filename = "out.ps", |
| double | x = 0., |
||
| double | y = 0., |
||
| double | width = 2000., |
||
| double | height = 2000., |
||
| GlgBoolean | portrait = True, |
||
| GlgBoolean | stretch = True, |
||
| GlgBoolean | center = True |
||
| ) |
Generates a PostScript output of the current state of the viewport's graphics.
This is a wrapper for GlgExportPostScript, which receives the method's parameters. See GlgExportPostScript for parameter descriptions.
| filename | See GlgExportPostScript for parameter description. |
| x,y | See GlgExportPostScript for parameter description. |
| width,height | See GlgExportPostScript for parameter description. |
| portrait | See GlgExportPostScript for parameter description. |
| stretch | See GlgExportPostScript for parameter description. |
| center | See GlgExportPostScript for parameter description. |
The drawing's hierarchy must be set up in order to generate PostScript output. Use Update before calling ExportPostScript to make sure the drawing is up to date.
| PlatformDependent GenerateImage | ( | char * | resource_name = NULL, |
| PlatformDependent | image = NULL |
||
| ) |
Creates and returns an image of the current state of the viewport's graphics.
This is a wrapper for GlgGenerateImage.
| resource_name | Specifies the resource path of a child viewport whose image to save, or NULL to save the image of this viewport. The resource path is relative to this viewport. |
| image | If not NULL, specifies a platform-dependent image to be used. This image will be filled and returned instead of creating and returning a new image. The type of the image is platform-dependent:
|
GenerateImage creates an image of the visible part of the viewport, clipping out the parts of the drawing that extends outside of it.
For a light viewport, the output will be generated for its parent viewport. The drawing's hierarchy must be set up in order to generate an image.
| PlatformDependent GenerateImageCustom | ( | char * | resource_name, |
| PlatformDependent | image, | ||
| GlgLong | x, | ||
| GlgLong | y, | ||
| GlgLong | width, | ||
| GlgLong | height, | ||
| GlgLong | gap | ||
| ) |
Creates an image of the specified rectangular region of the viewport's graphics.
This is a wrapper for GlgGenerateImageCustom.
| resource_name | Specifies the resource path of a child viewport whose image to save, or NULL to save the image of this viewport. The resource path is relative to this viewport. |
| image | If not NULL, specifies a platform-dependent image to be used. This image will be filled and returned instead of creating and returning a new image. The type of the image is platform-dependent:
|
| x | Specifies the X coordinate of the area used for generating an image. It defines an offset in screen pixels relative to the origin of the viewport's window, which has screen coordinates of (0,0). |
| y | Specifies the Y coordinate of the area used for generating an image. It defines an offset in screen pixels relative to the origin of the viewport's window, which has screen coordinates of (0,0). |
| width | Specifies the width in screen pixels of the area used for generating an image. |
| height | Specifies the height in screen pixels of the area used for generating an image. |
| gap | Specifies the padding space between the extent of the drawing and the border of the generated image in case when zero width and height parameters are specified. |
The x, y, width and height parameters may be obtained by querying the bounding box of either the whole drawing or of the area of the drawing for which the image needs to be generated using GetBoxPtr.
If width and height parameters are 0, the image of the whole drawing is generated using the drawing's bounding rectangle as the image generation area, without clipping to just the visible area. If the viewport is zoomed in, this area may be significantly bigger than the visible area of the viewport, and the image size may be quite large. The viewport's zoom factor defines the scaling factor for objects in the drawing when the image is saved.
For a light viewport, the output will be generated for its parent viewport. The drawing's hierarchy must be set up in order to generate an image.
| void OnDrawMetafile | ( | CDC * | print_dc | ) |
Windows only: Provides MFC metafile output support.
Is used by the MFC container's OnDrawMetafile method to produce metafile for the GLG child window.
If this object is a light viewport, the output will be generated for its parent viewport.
| print_dc | Specifies the printing device context for metafile output. |
| void OnPrint | ( | CDC * | print_dc | ) |
Windows only: Provides MFC printing support.
Is used by the MFC container's OnPrint method to print GLG child window. This is a wrapper for GlgOnPrint.
If this object is a light viewport, the output will be generated for its parent viewport.
| print_dc | Specifies the printing device context. |
| GlgBoolean Print | ( | PlatformDependent | print_context, |
| double | x = 0., |
||
| double | y = 0., |
||
| double | width = 2000., |
||
| double | height = 2000., |
||
| GlgBoolean | portrait = True, |
||
| GlgBoolean | stretch = True, |
||
| GlgBoolean | center = True |
||
| ) |
GTK and Windows only: Generates printing output of the current state of the viewport's graphics.
This is a wrapper for GlgNativePrint, which receives the method's parameters. See GlgNativePrint for parameter descriptions.
The drawing's hierarchy must be set up in order to print the drawing. Use Update before printing to make sure the drawing is up to date.
In the MFC environment on Windows, OnPrint may be used to support printing of the GlgControlC MFC wrapper.
| print_context | See GlgExportPostScript for parameter description. |
| x,y | See GlgExportPostScript for parameter description. |
| width,height | See GlgExportPostScript for parameter description. |
| portrait | See GlgExportPostScript for parameter description. |
| stretch | See GlgExportPostScript for parameter description. |
| center | See GlgExportPostScript for parameter description. |
| GlgBoolean SaveImage | ( | char * | resource_name, |
| char * | filename, | ||
| GlgImageFormat | format = GLG_JPEG |
||
| ) |
Generates a JPEG or PNG image of the current state of this viewport's graphics and saves it to a file.
This is a wrapper for GlgSaveImage.
| resource_name | Specifies the resource path of a child viewport whose image to save, or NULL to save the image of this viewport. The resource path is relative to this viewport. |
| filename | Specifies a filename in which to save the generated image. |
| format | Specifies an image format, must be GLG_JPEG or GLG_PNG. |
SaveImage saves an image of the visible part of the viewport, clipping out the parts of the drawing that extends outside of it.
For a light viewport, the output will be generated for its parent viewport. The drawing's hierarchy must be set up in order to generate an image.
| GlgBoolean SaveImageCustom | ( | char * | resource_name, |
| char * | filename, | ||
| GlgImageFormat | format, | ||
| GlgLong | x, | ||
| GlgLong | y, | ||
| GlgLong | width, | ||
| GlgLong | height, | ||
| GlgLong | gap | ||
| ) |
Generates a JPEG or PNG image of the specified rectangular region of the viewport's graphics and saves it to a file.
This is a wrapper for GlgSaveImageCustom.
| resource_name | Specifies the resource path of a child viewport whose image to save, or NULL to save the image of this viewport. The resource path is relative to this viewport. |
| filename | Specifies a filename in which to save the generated image. |
| format | Specifies an image format, must be GLG_JPEG or GLG_PNG. |
| x | Specifies the X coordinate of the area used for generating an image. It defines an offset in screen pixels relative to the origin of the viewport's window, which has screen coordinates of (0,0). |
| y | Specifies the Y coordinate of the area used for generating an image. It defines an offset in screen pixels relative to the origin of the viewport's window, which has screen coordinates of (0,0). |
| width | Specifies the width in screen pixels of the area used for generating an image. |
| height | Specifies the height in screen pixels of the area used for generating an image. |
| gap | Specifies the padding space between the extent of the drawing and the border of the generated image in case when zero width and height parameters are specified. |
The x, y, width and height parameters may be obtained by querying the bounding box of either the whole drawing or of the area of the drawing for which the image needs to be generated using GetBoxPtr.
If width and height parameters are 0, the image of the whole drawing is generated using the drawing's bounding rectangle as the image generation area, without clipping to just the visible area. If the viewport is zoomed in, this area may be significantly bigger than the visible area of the viewport, and the image size may be quite large. The viewport's zoom factor defines the scaling factor for objects in the drawing when the image is saved.
For a light viewport, the output will be generated for its parent viewport. The drawing's hierarchy must be set up in order to generate an image.