Cadcorp SIS API Methods

Render Method

Description

Creates an image of a given size to be displayed by the client browser.

Syntax

Visual Basic
Public Function Render( _
   ByVal xSize As Integer, _
   ByVal ySize As Integer, _
   ByVal strFormat As String _
) As String

Parameters

xSize
The x size in pixels to make the image.
 

ySize
The ysize in pixels to make the image.

strFormat
The format you want the image to be rendered in. The valid formats are:
 
image/jpeg JPEG is suitable for photographs, and is understood by almost all browsers.
image/gif GIF is suitable for displaying linework and is preferable to JPEG.
image/png PNG is the preferred format, suitable for displaying a mixture of vector and raster data, and understood by latest versions of most browsers.
image/bmp Windows BMP is an image file format understood by almost all browsers.
application/x-msmetafile Windows Meta File is understood by Internet Explorer and other browsers.
application/pdf;PaperFormat=… PDF will normally require a browser plugin. The PaperFormat parameter is mandatory; additional standard PDF formatting parameters can be supplied.

The following list gives the parameter names and values for image formats:

PhotometricInterpretation: (for PNG only, GIF & JPEG are implicitly PaletteColor)
- PaletteColor
- RGB
- RGBA

DitherPalette: (for PaletteColor only)
- ColorCube125
- ColorCube216
- BlackWhite
- GrayScale/GreyScale
- Adaptive
- OctTree
- Custom
- a literal palette, in the form RRGGBBRRGGBBRRGGBBRRGGBB....

DitherAlgorithm: (for PaletteColor only)
- Default
- SystemSnap
- SystemDither
- PaletteSnap
- FloydSteinberg

Transparent: (for PaletteColor and RGB only)
- True
- False

BGColor: (for PaletteColor and RGB only)
- RGB color in format 0xRRGGBB

Quality: (for JPEG only)
- number from 1 to 100

Additional "permission" parameters may be used as follows:

Key Value
PermissionPrinting   1/2 numbered top-down from GUI popup menu:  

1 - Print the document but not at the highest quality level

2 - Print the document to a representation from which a faithful digital copy of the PDF content could be generated

PermissionChanging   1/2/3/4 numbered top-down from GUI popup menu
 

1 - Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images)

2 - Fill in existing interactive form fields (including signature fields)

3 - Fill in existing interactive form fields (including signature fields) and add or modify text annotations

4 - Modify the contents of the document by operations other than those controlled by PermissionChanging=1, 2 or 3

PermissionCopying true or false
If true, users can copy or otherwise extract text and graphics from the document by operations other than those controlled by PermissionTextAccess.
PermissionTextAccess true or false
If true, visually-impaired users can read the document with screen readers.

Remarks

Note: Choose a format that is supported by the target users’ browsers. If they have a more recent browser, consider using PNG. If they have older browsers, choose JPEG. This method is usually put in its own ASP page. The applet or control used to display the map uses the separate page as the image source.

Available: GEO

Groups:

Example

sis.Render (512, 512, "image/png")
Creates a PNG image 512 x 512 pixels to be displayed in the client browser.

sis.Render (512, 512, "application/pdf;PaperFormat=A4,Title=MapImage" )
Creates a PDF document containing an image 512 by 512 pixels, to be displayed in the client browser. The document will be in A4 format with the title
MapImage.

Some example format strings with parameters:

image/png;PhotometricInterpretation=RGB
image/png;PhotometricInterpretation=PaletteColor,DitherPalette=OctTree
image/png;PhotometricInterpretation=PaletteColor,DitherPalette=OctTree,DitherAlgorithm=SystemSnap
image/gif;DitherPalette=OctTree,DitherAlgorithm=SystemSnap
image/jpeg;Quality=95
application/pdf;paperformat=A4,... + the usual parameters


Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).