Setting parameters about tracing center lines

1. The parameters of connecting adjacent vectors

2.The parameters of deleting fixed-up vectors

Setting parameters about calculating width

1.Set width calculating parameter

2.Clear the values of width series

3.Add one value of width series

4.Set the mode of processing more width

setting the parameters about adjusting angle

1. Set angle adjusting parameter

2. Clear all the values of angle series

3. Add one value of angle series

How to purchase the Raster to Vector Converter SDK DLL

-------

Raster to Vector Converter SDK (DLL) is developed by DWGTool Software . It can convert raster image into vector image, and output into dxf or text file. The format of raster image include bmp, jpg, tiff, pcx and tga.

It provides one main function and 12 parameter
setting functions to
complete the task. Please refer to the **VB** & **VC** sample to get the more detail of using method.The
follows is the detail of the 13 functions.

----------------------------------------------

**
1. Main function, convert
raster file into vector file
**

** int TraceRasterFile(**

** HWND ** OwnerWindow,
// handle of owner window

** LPCTSTR **Source,
// source raster file name

** LPCTSTR **Dest,
// vector file name

** int ** DestType,
// vector file type

** int ** TraceType,
// tracing method

** int ** Threshold,
// threshold of 1-bit image

** double **Straighten,
// straighten pixels into beelines

** int ** bRecCircle
// recognise the circle and arc

**);**

**Return Value**

if successfully, it return zero, otherwise it return none zero.

**Parameters
**

OwnerHanlde

indicate the window which will receive the messages sent by DLL,and the messages can be the follow values:

#define WM_USER_TRACE_FINISHED (WM_APP+100)Shows that the converting process is completed,if successfully, the WPARAM parameter is 0,otherwise the WPARAM parameter is none 0

#define WM_USER_TRACE_PROGRESS_BEGIN (WM_APP+101)

Shows begin a progress, and the LPARAM parameter is the LPCTSTR type, shows the progress name

#define WM_USER_TRACE_PROGRESS (WM_APP+102)

Shows the position of current progress, the WPARAM parameter is the current position of current progress, the max value is 100

#define WM_USER_TRACE_PROGRESS_END (WM_APP+103)Shows the current progress is completed

source

Raster image file name, can be the .bmp, .jpeg, .tiff, .pcx, .tga formats raster file.

Dest

Vector file name, the extension can be .dxf, .txt, .plt, .svg, .eps. But the output file type is decided by the below paramter DestType.

DestType

The format of outputing vector file, can be the follow values:

0-Dxf, 1-text, 2-HP/GL, 3-Svg, 4-EPS

TraceType

Trace method: 0 - Trace Outline, 1 - Trace Center line

Threshold

the threshold converting into 1-bit image, not greater than 255, If this value is negative, DLL will calculate one good threshold auto.

Straighten

Straighten indicates when curve is pulled into beeline,the dot in the curve is the maximum distance from the beeline.

RecCircle

if 0, don't recognise circle or arc, if none 0, recognise the circle and arc.

**Remarks**

The output file formats of .DXF, .SVG, .HP/GL,and .EPS are standard formats, but the text format is defined by us self. The follow is the format of text file:

**Format
of the text file**

One text line is one line, or one circle, or one arc.and their formats is described as follow:

**Line
format**

The format of one line like this:

lX start point, Y start point, X end point, Y end point

The leader character is lower-case letter "l", eg:

l1.0,2.0,10.0,11.0

Shows a line start from (1.0,2.0) to (10.0,11.0)

**Circle
format**

The format of one circle like this:

cX center point,Y center point,Radius

The leader character is lower-case letter "c",eg:

c5.0,6.0,10.0

Show a circle, its center point is (5.0,6.0),and radius is 10.0

**Arc
format**

The format of one arc like this:

aX center point,Y center point,Radius,Start angle,End angle

The leader character is lower-case letter "a", the angle units is radians, and arc must be counter-clockwise,eg:

a5.0,6.0,10.0,0.0,3.14159265

Shows a arc, its center point is (5.0,6.0),radius is 10.0, start angle is 0 degrees, and end angle is 180 degrees(PI radians), and this is a half circle.

And there is a lisp named "LoadText.lsp" in the package, which can read the text file into AutoCAD. Please load the lisp into AutoCAD first and then type the command "RTT" to read the text file.

If you only trace the outline of the raster image, call this function only, because all the parameter are set by this function. The follow parameters are for tracing center line.

**Setting
parameters of tracing center lines functions**

The follow functions are used to setting parameters of tracing center lines. But these parameters haven't any means to tracing outline.

** void SetConnectDistance(**

** int ** Connect,
// If connect adjacent vectors

** int **Distance
// the maximum distance between adjacent vectors

**);**

**Parameters
**

Connect

if Connect is 0, DLl don't connect the adjacent line, if Connect isn't 0, DLl will connect the adjacent line.

Distance

Connection distance is that when connect two beeline segments, the distance is the maximum value from one beeline segment dot to another beeline segment dot.

** void SetDeleteLength(**

**int** Delete,
// if delete the fixed-up vectors

**int**
Length // the maximum length of fixed-up vectors

);

**Parameters
**

Delete

If delete is 0, don't delete any vectors, if delete isn't 0, DLL will delete the lines which length is smaller than the parameter Length

Length

The maximum length of fixed-up vectors.

**The
follow functions set the parameters about calculating the width of vectors.**

**1.Set
width calculating parameter**

**void SetCalcWidth(**

**int**
Calc // If calculating width of vectors

);

**Parameters
**

Calc

if Calc is 0, DLL don't calculate the width of vectors, if Calc isn't 0, DLl will calculate the width of vectors.

**2.Clear
the values of width series**

** void DeleteAllWidthSeries(void);**

**Remarks**

Clear all the values of width series.If
you don't need any width series, you must call this function. Otherwise, if
there are some values which you have added, them will still have effect to the
tracing progress.

**3.
Add one value of width series**

** void AddWidthSeriesValueFun(**

** ****double **Width
// the width value that will be added

**);**

**Parameters
**

Width

The width value that will be add into current width series.

**Remarks**

Call this function continually to add all the values of width series. Before add the first value, you must call
the function "DeleteAllWidthSeries" to clear all the values of width series.

The width of vector will be rounded
into the width series, For example, the values of width sereies are 0.0, 0.5,
1.0, and 1.5 mm, if the width of a vector is 0.8mm, according to this
width series, the width of this vector will be rounded to 1.0mm, but if the
width of this vector is 0.7mm, it will be rounded to 0.5mm.

**4.Set the mode of processing more width**

** void SetMoreWidthMode(**

** ****int **Mode
// the mode of processing more width

**);**

**Parameters
**

Mode

The mode of processing more width, see remarks for details.

**Remarks**

Set the method of process the width which is greater than the maximun width in the current width series. It can be the follow values:

0all the width that is greater than the max width in the width series will be shrink to the max width., eg:

if the width series is 1mm, 2mm, 3mm, the width of a vector is 5.8mm, it will be shrink into 3mm.

1the width that is greater than the max width will not be changed,, eg:

if the width series is 1mm, 2mm, 3mm, the width of a line is 5.8mm, it will not be changed, and it still is 5.8mm.

2the width that is greater than the max width will be rounded into the width by the equal space method, eg:

if the width series is 1mm, 2mm, 3mm, the width of a line is 5.8mm, it will be rounded into 6mm.

**5. Set the
values of width series into default values**

** void SetDefaultWidthSeries(void);**

**Remarks**

set the values of width series into default values, and the default values is:
0.5mm, 1.0mm, 2.0mm, the mode of processing more widht is 1, means no changing.

**The
follow functions set the parameters about adjusting the angle of vectors.**

**1.
Set angle adjusting parameter**

** void SetAdjustAngle(**

** ****int**
Adjust

**);**

**Parameter**

Adjust

If adjust is 0, DLL don't adjust the angle of vectors, and if adjust isn't 0, DLL will adjust the angle of vectors.

**2.
Clear all the values of angle series**

** void DeleteAllAngleSeries(void);**

**Remarks**

if you clear all the values of angle series, you must add the new values of angle series, or call the functions
"SetDefaultAngleSeries" or "SetOrthoAngleSeries" to add predefined values,
otherwise, DLL can't adjust the angle, because there is no adjusting basis.

**3. Add one value of angle series
**

** int AddAngleSeriesValue(**

** ****double **MinAngle,
// minimum angle of angle series, the units is radians

** ****double **MaxAngle,
// maximum angle of angle series, the units is radians

** ****double **MainAngle
// main angle of angle series, the units is radians

**);**

**Return Value**

if successfully, the return valuse is none zero, otherwise is 0.

**Parameters**

MinAngle

Min angle of angle series, the units is radians. Please see remarks for details.

MaxAngle

Max angle of angle series, the units is radians. Please see remarks for details.

MainAngle

Main angle of angle series, the units is radians. Please see remarks for details.

**Remarks**

Call this function continually to add all the values of angle series, before add the first value, you should call the function "DeleteAllAngleSeries".

The rule of angle adjusting is : when the angle of vector is greater than the min angle and is smaller than the max angle, it will be adjusted to main angle.eg:

if the angle series like this:

Main angle(Degrees) |
Min angle(Degrees) |
Max angle(Degrees) |

0.0 |
0.0 |
1.0 |

90.0 |
91.0 |
89.0 |

180.0 |
179.0 |
180.0 |

So, if one vector's angle is 89.5 degrees, its angle will be adjusted to 90.0 degrees. If another vector's angle is 88.5 degrees, its angle will not be adjusted, and still maintain 88.5 degrees.

**Note**

MinAngle isn't greater than MainAngle, and MaxAngle isn't smaller than MainAngle.

All the angle must be greater or equal to
0 degrees(0 radians), and must be smaller or equal to 180 degrees(PI radians).

** void SetDefaultAngleSeriesFun(void);**

**Remarks
**

Set the values of angle series into default values, and the default values is:

Main angle(degree) |
Max angle(degrees) |
Min angle(degrees) |

0.0 |
1.0 |
0.0 |

30.0 |
31.0 |
29.0 |

45.0 |
46.0 |
44.0 |

60.0 |
61.0 |
59.0 |

90.0 |
91.0 |
89.0 |

120.0 |
121.0 |
119.0 |

135.0 |
136.0 |
134.0 |

150.0 |
151.0 |
149.0 |

180.0 |
180.0 |
179.0 |

** void SetOrthoAngleSeries(void);**

**Remarks**

Set the values of angle series into ortho values, and the ortho values is:

Main angle(degrees) |
Max angle(degrees) |
Min angle(degrees) |

0.0 |
1.0 |
0.0 |

90.0 |
91.0 |
89.0 |

180.0 |
180.0 |
179.0 |

**How to purchase Raster to Vector Converter SDK DLL**

----------------------------------------

Recommend you to try out our software before you decide to buy our software. In the demo version, we will add a TraceART icon into the vector file. Of course, it will be deleted in the full version.

Buy now ( $799.5 USD) |

Raster to Vector Converter SDK DLL Homepage: www.dwgtool.com

Copyright ©2000-2017 DWGTool Software. All Rights Reserved.