|
GLG Toolkit, C / C++ API Library
Version 4.6
|
This group contains functions used for printing, generating PostScript output and saving images. More...
This group contains functions used for printing, generating PostScript output and saving images.
Functions | |
| GlgBoolean | GlgExportPostScript (GlgObject object, char *file, double x, double y, double width, double height, GlgBoolean portrait, GlgBoolean stretch, GlgBoolean center) |
| Generates a PostScript output of the current state of the viewport's graphics. More... | |
| PlatformDependent | GlgGenerateImage (GlgObject object, char *resource_name, PlatformDependent image) |
| Creates and returns an image of the current state of the viewport's graphics. More... | |
| PlatformDependent | GlgGenerateImageCustom (GlgObject object, 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... | |
| GlgBoolean | GlgNativePrint (GlgObject object, PlatformDependent print_context, double x, double y, double width, double height, GlgBoolean stretch, GlgBoolean center) |
| GTK and Windows only: Generates printing output of the current state of the viewport's graphics. More... | |
| GlgBoolean | GlgSaveImage (GlgObject object, char *resource_name, char *filename, GlgImageFormat format) |
| Generates a JPEG or PNG image of the current state of the viewport's graphics and saves it to a file. More... | |
| GlgBoolean | GlgSaveImageCustom (GlgObject object, 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 GlgExportPostScript | ( | GlgObject | object, |
| char * | file, | ||
| double | x, | ||
| double | y, | ||
| double | width, | ||
| double | height, | ||
| GlgBoolean | portrait, | ||
| GlgBoolean | stretch, | ||
| GlgBoolean | center | ||
| ) |
Generates a PostScript output of the current state of the viewport's graphics.
| object | Specifies a viewport. If object is a light viewport, the output will be generated for its parent viewport. |
| file | Specifies a filename in which to save the generated PostScript output. |
| x | Defines the X coordinate of the upper left corner of the rectangle on the page containing the PostScript output. All coordinates are specified in the world coordinate system, which maps a rectangle defined by the points (0;0) and (2000;2000) to a page. |
| y | Defines the Y coordinate of the upper left corner of the rectangle. |
| width | Defines the width of the rectangle. |
| height | Defines the height of the rectangle. |
| portrait | Specifies the orientation of the PostScript output on the page. If True, a portrait orientation is used, otherwise a landscape orientation is used. |
| stretch | Specifies whether or not PostScript output should be stretched when mapping it to the specified rectangle:
|
| center | Specifies whether or not PostScript output should be centered inside the specified output rectangle when stretch=False results in unused space on the sides of the rectangle. If True, the output will be centered inside the output area, otherwise it will be anchored in the upper left corner of the rectangle. |
The drawing's hierarchy must be set up in order to generate PostScript output. Use GlgUpdate before calling GlgExportPostScript to make sure the drawing is up to date.
| PlatformDependent GlgGenerateImage | ( | GlgObject | object, |
| char * | resource_name, | ||
| PlatformDependent | image | ||
| ) |
Creates and returns an image of the current state of the viewport's graphics.
| object | Specifies a viewport object or a viewport's parent. |
| resource_name | Specifies the resource path of a child viewport whose image to generate, or NULL to generate the image of the viewport specified by the object parameter. The resource path is relative to the object specified by the object parameter. |
| 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:
|
GlgGenerateImage 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 GlgGenerateImageCustom | ( | GlgObject | object, |
| 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.
| object | Specifies a viewport object or a viewport's parent. |
| resource_name | Specifies the resource path of a child viewport whose image to generate, or NULL to generate the image of the viewport specified by the object parameter. The resource path is relative to the object specified by the object parameter. |
| 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 GlgGetBoxPtr.
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.
| GlgBoolean GlgNativePrint | ( | GlgObject | object, |
| PlatformDependent | print_context, | ||
| double | x, | ||
| double | y, | ||
| double | width, | ||
| double | height, | ||
| GlgBoolean | stretch, | ||
| GlgBoolean | center | ||
| ) |
GTK and Windows only: Generates printing output of the current state of the viewport's graphics.
| object | Specifies a viewport. If object is a light viewport, the output will be generated for its parent viewport. |
| print_context | A platform-depended print context:
|
| x | Defines the X coordinate of the upper left corner of the rectangle on the page containing the output. All coordinates are specified in the world coordinate system, which maps a rectangle defined by the points (0;0) and (2000;2000) to a page. |
| y | Defines the Y coordinate of the upper left corner of the rectangle. |
| width | Defines the width of the rectangle. |
| height | Defines the height of the rectangle. |
| stretch | Specifies whether or not printed output should be stretched when mapping it to the specified rectangle:
|
| center | Specifies whether or not printed output should be centered inside the specified output rectangle when stretch=False results in unused space on the sides of the rectangle. If True, the output will be centered inside the output area, otherwise it will be anchored in the upper left corner of the rectangle. |
The drawing's hierarchy must be set up in order to print the drawing. Use GlgUpdate before printing to make sure the drawing is up to date.
In the MFC environment on Windows, GlgOnPrint may be used to support printing of the GlgControlC MFC wrapper.
| GlgBoolean GlgSaveImage | ( | GlgObject | object, |
| char * | resource_name, | ||
| char * | filename, | ||
| GlgImageFormat | format | ||
| ) |
Generates a JPEG or PNG image of the current state of the viewport's graphics and saves it to a file.
| object | Specifies a viewport object or a viewport's parent. |
| resource_name | Specifies the resource path of a child viewport whose image to save, or NULL to save the image of the viewport specified by the object parameter. The resource path is relative to the object specified by the object parameter. |
| filename | Specifies a filename in which to save the generated image. |
| format | Specifies an image format, must be GLG_JPEG or GLG_PNG. |
GlgSaveImage 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 GlgSaveImageCustom | ( | GlgObject | object, |
| 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.
| object | Specifies a viewport object or a viewport's parent. |
| resource_name | Specifies the resource path of a child viewport whose image to save, or NULL to save the image of the viewport specified by the object parameter. The resource path is relative to the object specified by the object parameter. |
| 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 GlgGetBoxPtr.
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.