".red" file format
Each entity in the .red file contains keywords and the keywords are separated by comma (","). For CV7, all entities
except text entity are stored as polyline entities. The format for Line, Circle and Cloud are for CV6 .red file format.
The general format for each entity is as follow:
Line
shape,x1,y1,x2,y2{c,r,b,g}
- 1) Shape="L"
- 2) x1,y1 are coordinates of the start point of the line segment
- 3) x2,y2 are coordinates of the end point of the line segment
- 4) Color keyword "c" is embraced in { and }
- Example:
- A line with two end points (0,0), (100,100) and color (255,0,0) is defined as:
- L,0,0,100,100,{c,255,0,0,}
Polyline
shape,w,n,x1,y1,x2,y2,...,xn,yn{c,r,b,g}
- 1) Shape="p" or "h"
- p: polygon including rectangle
- h: highlight rectangle
- 2) n=number of vertices of the polygon
- 3) xi,yi are the coordinates of vertex i
- 4) Linethickness keyword: "w", value are integers
- 5) Color keyword "c" is embraced in { and }
- Example:
- A polygon with 5 vertices, lineweight=0 andd color (255,0,0) is defined as:
- p,w=0,5,-160,15621,-160,10513,7258,10513,7258,15621,160,15621,{c,255,0,0,}
Circle and Clouds
shape,x,y,r{c,r,b,g}
- 1) Shape="D" or "C"
- 2) x,y are coordinates of the center of the circle or cloud
- 3) r is the radius of the circle or cloud
- 4) Color keyword "c" is embraced in { and }
Text
shape,x,y,height,text,font name, font style, font size{c,r,b,g}
- 1) Shape="T"
- 2) x,y are coordinates of the baseline of the first character
- 3) height is the height of the character
- 4) font name is the font name
- 5) font style: 0 for plain, 1 for bold, 2 for italic
- 6) font size is the size of the font
-
- 7) Color keyword "c" is embraced in { and }
- Example:
- A text message "This is a test" located at (0,0) and in bold TimesRoman font size 25 is defined as:
- T,0,0,0,This is a test,TimesRoman,1,25,{c,255,0,0,}