The CompDocEditor object is used to edit raster drawings. Every TslCompDoc object contains a CompDocEditor object associated with it. In order to edit a document (connected with TslCompDoc object), the interface to the CompDocEditor object has to be obtained. That is possible due to the GetCompDocEditor method of the TslCompDoc object.

All the methods return a non-zero value on error. A zero return value indicates that the operation has been finished with success and free of errors in the meantime.

If any error occurs while editing a raster drawing, an exception is thrown so that an OLE client is informed (with the appropriate message) what has happened.

The default units (inches) are taken as the parameters’ units, and all raster operations work on world coordinates in inches.

Calibrate

Runs the calibration proces using given parameters.

Syntax:

Editor.Calibrate VectorsFile, ModelID, ReportFile

VectorsFile

STRING value containing the path to a file with calibration vectors

ModelID

SHORT value indicating the calibration model:

0 – Helmert model

1 – Affine model

2 – Bilinear model

3 – Biquadratic model

4 – Bicubic model

ReportFile

STRING value containing the path to the calibration report file

Editor

An object expression that evaluates to a CompDocEditor object

CalibrateEx

Runs the calibration process using given parameters. CalibrateEx calculates actual and desired net itself, basing on series of freely placed actual raster points (SrcPntsXY) and their desired positions(DstPntsXY), using chosen calibration model.

Syntax:

Editor.CalibrateEx Xmin, Ymin, Xmax, Ymax, ModelId, Dir, PixelSize, SrcPntsXY, DstPntsXY

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be calibrated

MinY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle to be calibrated

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be calibrated

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be calibrated

ModelID

SHORT value indicating the calibration model:

0 – Helmert model

1 – Affine model

2 – Bilinear model

3 – Biquadratic model

4 – Bicubic model

Dir

SHORT value – must be set to 0

PixelSize

DOUBLE value - dimension of raster pixel, in the same units as XMin, ..., YMax

SrcPointsXY

ARRAY with the values of the polygon’s points’ x,y-coordinates, in the appropriate order

DstPointsXY

ARRAY with the values of the polygon’s points’ x,y-coordinates, in the appropriate order

Editor

An object expression that evaluates to a CompDocEditor object

CalibrateNet

Runs the calibration proces using given parameters. Function CalibrateNet assumes already calculated actual and desired net. Actual net (SrcPntsXY) should be orthogonal, desired one (DstPntsXY) should show desired positions of actual net points.

Syntax:

Editor.CalibrateNet CntX, CntY, SrcPntsXY, DstPntsXY

CntX

SHORT value

CntY

SHORT value

SrcPointsXY

ARRAY with the values of the polygon’s points’ x,y-coordinates, in the appropriate order

DstPointsXY

ARRAY with the values of the polygon’s points’ x,y-coordinates, in the appropriate order

Editor

An object expression that evaluates to a CompDocEditor object

ChangeDensity

Changes image density to the specified one.

Syntax:

Editor.ChangeDensity DensX, DensY

DensX

DOUBLE value, indicating the document’s new density in the x-coordinate direction

DensY

DOUBLE value, indicating the document’s new density in the y-coordinate direction

Editor

An object expression that evaluates to a CompDocEditor object

ChangeFormat

Changes the drawing extents to the specified rectangle. Parameters should be in inches.

Syntax:

Editor.ChangeFormat StartX, StartY, EndX, EndY

StartX

DOUBLE value, indicating the new x-coordinate position of the document’s left border

StartY

DOUBLE value, indicating the new y-coordinate position of the document’s bottom border

EndX

DOUBLE value, indicating the new x-coordinate position of the document’s right border

EndY

DOUBLE value, indicating the new x-coordinate position of the document’s top border

bError

SHORT value – nonzero on error

Editor

An object expression that evaluates to a CompDocEditor object

ClearPolygon

Clears the drawing using polygon, defined with array with points’ coordinates (X , Y).

Syntax:

Editor.ClearPolygon PointsXY

PointsXY

ARRAY with the values of the polygon’s points’ x-coordinates and y-coordinates, in the appropriate order

Editor

An object expression that evaluates to a CompDocEditor object

ClearRectangle

Clears the specified rectangle within the document. Parameters should be in inches.

Syntax:

Editor.ClearRectangle StartX, StartY, EndX, EndY

StartX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be cleared

StartY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle to be cleared

EndX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be cleared

EndY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be cleared

Editor

An object expression that evaluates to a CompDocEditor object

CopyPolygon

Copies the specified polygon (defined in the same way as in the ClearPolygon method) from the active drawing to a file (given by name: FileName). The new drawing is put into the world in the point (InsPointX, InsPointY).

Syntax:

Editor.CopyPolygon PointsXY, InsPointX, InsPointY, FileName

PointsXY

ARRAY with the values of the polygon’s points’ x,y-coordinates, in the appropriate order

InsPointX

DOUBLE value with the x-coordinate of the insertion point

InsPointY

DOUBLE value with the y-coordinate of the insertion point

FileName

STRING containing the name of the file, where the copied polygon is to be written to

Editor

An object expression that evaluates to a CompDocEditor object

CopyRectangle

Copies the specified (with MinX, MinY, MaxX and MaxY) rectangle from the active drawing to a file (given by name: FileName). The new drawing is put into the world in the point (InsPointX, InsPointY).

Syntax:

Editor.CopyRectangle MinX, MinY, MaxX, MaxY, InsPointX, InsPointY, FileName

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be copied

MinY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle to be copied

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be copied

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be copied

InsPointX

DOUBLE value with the x-coordinate of the insertion point

InsPointY

DOUBLE value with the y-coordinate of the insertion point

FileName

STRING containing the name of the file, where the copied rectangle is to be written to

Editor

An object expression that evaluates to a CompDocEditor object

CropPolygon

Cuts the drawing to the specified polygon. Polygon is defined in the same way as in the ClearPolygon method.

Syntax:

Editor.CropPolygon PointsXY

PointsXY

ARRAY with the values of the polygon’s points’ x-coordinates and y-coordinates, in the appropriate order

Editor

An object expression that evaluates to a CompDocEditor object

CutPolygon

Removes the specified polygon (defined in the same way as in the ClearPolygon method) from the active drawing and writes it to a file (given by name: FileName). The new drawing is put into the world in the point (InsPointX, InsPointY).

Syntax:

Editor.CutPolygon PointsXY, InsPointX, InsPointY, FileName

PointsXY

ARRAY with the values of the polygon’s points’ x,y-coordinates, in the appropriate order

InsPointX

DOUBLE value with the x-coordinate of the insertion point

InsPointY

DOUBLE value with the y-coordinate of the insertion point

FileName

STRING containing the name of the file, where the cut polygon is to be written to

Editor

An object expression that evaluates to a CompDocEditor object

CutRectangle

Removes the specified (with MinX, MinY, MaxX and MaxY) rectangle from the active drawing and writes it to a file (given by name: FileName). The new drawing is put into the world in the point (InsPointX, InsPointY).

Syntax:

Editor.CutRectangle MinX, MinY, MaxX, MaxY, InsPointX, InsPointY, FileName

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be cut

MinY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle to be cut

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be cut

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be cut

InsPointX

DOUBLE value with the x-coordinate of the insertion point

InsPointY

DOUBLE value with the y-coordinate of the insertion point

FileName

STRING containing the name of the file, where the cut rectangle is to be written to

Editor

An object expression that evaluates to a CompDocEditor object

FilterSpots

Filters drawing from spots (or holes – if Holes parameter set to TRUE) which single sizes do not exceed SpotSize. The operation is done within the specified rectangular area only.

Syntax:

Editor.FilterSpots MinX, MinY, MaxX, MaxY, SpotSize, Holes

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be filtered

MinY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle to be filtered

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be filtered

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be filtered

SpotSize

LONG parameter, specifying the maximal spot/hole size that is not removed

Holes

BOOLEAN value, TRUE -if holes (FALSE -if spots) are to be removed

Editor

An object expression that evaluates to a CompDocEditor object

GetMaxSpot

Returns, in the SpotSize parameter, size of the maximal spot (or hole – if Holes parameter set to TRUE) found within the specified rectangular area.

Syntax:

Editor.Editor. GetMaxSpot (MinX, MinY, MaxX, MaxY, Holes)

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be searched

MinY

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be searched

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be searched

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be searched

Holes

BOOLEAN value, TRUE -if holes (FALSE -if spots) are to be searched

SpotSize

LONG parameter, receiving the size of the maximal spot/hole found

Editor

An object expression that evaluates to a CompDocEditor object

GetMinPixelSize

Returns (in parameters) size of the minimal pixel, in both directions (X and Y).

Syntax:

Editor.GetMinPixelSize MinPixX, MinPixY

MinPixX

DOUBLE value, indicating the x-coordinate of the minimal pixel’s size

MinPixY

DOUBLE value, indicating the y-coordinate of the minimal pixel’s size

Editor

An object expression that evaluates to a CompDocEditor object

Merge

Merges the selected elements of composite document into one picture and writes it the file DestFileName in the specified format and subformat. The newly created drawing can be forced the specified scale and resolutions (in order to cope the situation when selected drawings have different resolutions and scales). This command is available only for composite documents if there is more than one single component selected.

Syntax:

Editor.Merge DestFileName, FormatName, SubformatName, Scale, ResolutionX, ResolutionY

DestFileName

STRING containing the name of the newly created raster (with the merged drawings)

FormatName

STRING specifying the format name of the created raster

FubformatName

STRING specifying the subformat name of the created raster

Scale

DOUBLE value, containing the scale the merged elements are to be put together to the new raster

ResolutionX

DOUBLE value, containing the resolution of the new raster in the x-direction

ResolutionY

DOUBLE value, containing the resolution of the new raster in the y-direction

Editor

An object expression that evaluates to a CompDocEditor object

ModifyTransparentMask

Changes transparent mask to the specified one (with the Mode parameter). The operation is applied to the given rectangle only.

Syntax:

Editor.ModifyTransparentMask MinX, MinY, MaxX, MaxY, Mode

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle the mask is to be modified within

MinY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle the mask is to be modified within

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle the mask is to be modified within

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle the mask is to be modified within

Mode

SHORT parameter, specifying the way the mask is to be changed:

2 – select all,

3 – invert all,

4 – remove mask.

Editor

An object expression that evaluates to a CompDocEditor object

Move

Change image insertion point with ShiftX (X coordinate) and ShiftY (Y coordinate). Parameters should be in inches.

Syntax:

Editor.Move ShiftX, ShiftY

ShiftX

DOUBLE value, indicating the number of units (inches) the raster is moved in the x-coordinate direction

ShiftY

DOUBLE value, indicating the number of units (inches) the raster is moved in the y-coordinate direction

Editor

An object expression that evaluates to a CompDocEditor object

PasteImage

Puts a raster drawing specified by FileName into the active document . The element that is pasted, is placed in the point (PlacementX, PlacementY) of the document. It can be scaled and rotated of the specified angle relatively to the point (ptBaseX, ptBaseY) in its world coordinates.

Syntax:

Editor.PasteImage FileName, PlacementX, PlacementY, ptBaseX, ptBaseY, Angle, ScaleX, ScaleY

FileName

STRING value with the file name of the drawing to be pasted

PlacementX

DOUBLE value, specifying the x-coordinate of the place, where the specified drawing is to be pasted into the document

PlacementY

DOUBLE value, specifying the y-coordinate of the place, where the specified drawing is to be pasted into the document

ptBaseX

DOUBLE value, containing the x-coordinate of the base point

ptBaseY

DOUBLE value, containing the y-coordinate of the base point

Angle

DOUBLE value, containing the angle the pasted drawing is to be rotated on

ScaleX

DOUBLE value, containing the scale in the x-direction

ScaleY

DOUBLE value, containing the scale in the y-direction

Editor

An object expression that evaluates to a CompDocEditor object

ResizePolygon

Resizes the specified polygon (defined in the same way as in the ClearPolygon method) relatively to the point (ptBaseX, ptBaseY), with the given scales (appropriate for directions X and Y).

Syntax:

Editor.ResizePolygon PointsXY, ptBaseX, ptBaseY, ScaleX, ScaleY

PointsXY

ARRAY with the values of the polygon’s points’ x,y-coordinates, in the appropriate order

ptBaseX

DOUBLE value with the x-coordinate of the relative base-point

ptBaseY

DOUBLE value with the y-coordinate of the relative base-point

ScaleX

DOUBLE value, indicating the scale in the x-direction

ScaleY

DOUBLE value, indicating the scale in the y-direction

Editor

An object expression that evaluates to a CompDocEditor object

ResizeRectangle

Resizes the specified (with MinX, MinY, MaxX and MaxY) rectangle relatively to the point (ptBaseX, ptBaseY), with the given scales (appropriate for directions X and Y).

Syntax:

Editor.ResizeRectangle MinX, MinY, MaxX, MaxY, ptBaseX, ptBaseY, ScaleX, ScaleY

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be resized

MinY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle to be resized

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be resized

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be resized

ptBaseX

DOUBLE value with the x-coordinate of the relative base-point

ptBaseY

DOUBLE value with the y-coordinate of the relative base-point

ScaleX

DOUBLE value, indicating the scale in the x-direction

ScaleY

DOUBLE value, indicating the scale in the y-direction

Editor

An object expression that evaluates to a CompDocEditor object

RotatePolygon

Rotates the specified polygon (defined in the same way as in the ClearPolygon method) around the point (ptCenterX, ptCenterY), with the given Angle.

Syntax:

Editor.RotatePolygon PointsXY, ptCenterX, ptCenterY, Angle

PointsXY

ARRAY with the values of the polygon’s points’ x,y-coordinates, in the appropriate order

ptCenterX

DOUBLE value with the x-coordinate of the center point of the rotation

ptCenterY

DOUBLE value with the y-coordinate of the center point of the rotation

Angle

DOUBLE value, indicating the rotation angle

Editor

An object expression that evaluates to a CompDocEditor object

RotateRectangle

Rotates the specified (with MinX, MinY, MaxX and MaxY) rectangle around the point (ptCenterX, ptCenterY), with the given Angle.

Syntax:

Editor.RotatateRectangle MinX, MinY, MaxX, MaxY, ptCenterX, ptCenterY, Angle

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be rotated

MinY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle to be rotated

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be rotated

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be rotated

ptCenterX

DOUBLE value with the x-coordinate of the center point of the rotation

ptCenterY

DOUBLE value with the y-coordinate of the center point of the rotation

Angle

DOUBLE value, indicating the rotation angle

Editor

An object expression that evaluates to a CompDocEditor object

RotateRectangle90

Rotates the given (with MinX, MinY, MaxX and MaxY) rectangle in a way specified by Angle.

Syntax:

Editor.RotatateRectangle90 MinX, MinY, MaxX, MaxY, Angle

MinX

DOUBLE value, indicating the x-coordinate position of the left border of the rectangle to be rotated

MinY

DOUBLE value, indicating the y-coordinate position of the bottom border of the rectangle to be rotated

MaxX

DOUBLE value, indicating the x-coordinate position of the right border of the rectangle to be rotated

MaxY

DOUBLE value, indicating the y-coordinate position of the top border of the rectangle to be rotated

Angle

LONG value, indicating the way of rotation:

1 – rotate left with 90,

2 – rotate left with 180,

3 – rotate right with 90,

4 – vertical mirror,

5 – vertical mirror + rotate right with 90,

6 – horizontal mirror,

7 – horizontal mirror + rotate right with 90.

Editor

An object expression that evaluates to a CompDocEditor object

TransparentClearPolygons

Removes the specified transparent colors from polygons (defined in the same way as in the ClearPolygons method).

Syntax:

Editor.TransparentClearPolygons PointsXY, PolyCounts

PointsXY

ARRAY with the values of the polygons’ points’ x,y-coordinates; polygons and their points in the appropriate order

PolyCounts

ARRAY with the polygons’ sizes

Editor

An object expression that evaluates to a CompDocEditor object

loading table of contents...