|
GLG Toolkit, C# Class 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 | |
| Bitmap | CreateImage (String resource_name) |
| Creates and returns an image of the current state of the viewport's graphics. More... | |
| Bitmap | CreateImageCustom (String resource_name, System.Drawing.Rectangle image_area, int gap) |
| Creates an image of the specified rectangular region of the viewport's graphics. More... | |
| bool | ExportPostScript (String file, double x, double y, double width, double height, bool portrait, bool stretch, bool center) |
| Generates a PostScript output of the current state of the viewport's graphics. More... | |
| bool | NativePrint (Graphics graphics) |
| Generates printing output of the current state of the viewport's graphics. More... | |
| static bool | SaveImage (Bitmap image, String image_file, System.Drawing.Imaging.ImageFormat image_format) |
| Saves an image to a file in a requested format. More... | |
| Bitmap CreateImage | ( | String | resource_name | ) |
Creates and returns an image of the current state of the viewport's graphics.
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.
| resource_name | The resource path of a child viewport whose image to generate, or null to generate the image of the viewport the method is invoked on. The resource path is relative to the invoking object. |
| Bitmap CreateImageCustom | ( | String | resource_name, |
| System.Drawing.Rectangle | image_area, | ||
| int | gap | ||
| ) |
Creates an image of the specified rectangular region of the viewport's graphics.
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.
| resource_name | The resource path of a child viewport whose image to generate, or null to generate the image of the viewport the method is invoked on. The resource path is relative to the invoking object. |
| image_area | The area used to generating an image of. The area is defined in screen pixels relative to the origin of the viewport's window, which has screen coordinates of (0,0). |
| gap | Specifies the padding space between the extent of the drawing and the border of the generated image in case when width and height of the image_area are set to zero, see below. |
The extent of the image area 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 GetBox.
If width and height of the image_area are set to 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.
| bool ExportPostScript | ( | String | file, |
| double | x, | ||
| double | y, | ||
| double | width, | ||
| double | height, | ||
| bool | portrait, | ||
| bool | stretch, | ||
| bool | center | ||
| ) |
Generates a PostScript output of the current state of the viewport's graphics.
If the 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 UpdateGlgbefore calling ExportPostScript to make sure the drawing is up to date.
| bool NativePrint | ( | Graphics | graphics | ) |
Generates printing output of the current state of the viewport's graphics.
If the object is a light viewport, the output will be generated for its parent viewport.
| graphics | Print graphics context. |
|
static |
Saves an image to a file in a requested format.
CreateImage can be used to generates an image of the current state of a viewport's graphics
| image | Image to save. |
| image_file | Filename to save the image to. |
| image_format | Image format to use. |