-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathline_style.cpp
48 lines (43 loc) · 1.41 KB
/
line_style.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @file line_style.cpp
* @author Sebastien Fourey (GREYC)
*
* @brief Sample program to check line styles.
*
* This source code is part of the Board project, a C++ library whose
* purpose is to allow simple drawings in EPS, FIG or SVG files.
* Copyright (C) 2007 Sebastien Fourey <https://fourey.users.greyc.fr>
*
*/
#include <Board.h>
using namespace LibBoard;
int main(int, char *[])
{
Board board;
board.clear(Color::White);
board.setLineWidth(0.5);
int y = 10;
board.setFillColor(Color::Gray);
board.setLineStyle(DashStyle);
board.drawRectangle(10, y, 200, 10);
y += 20;
Style style = board.style();
board << rectangle(10, y, 200, 10, style.withLineStyle(DotStyle));
y += 20;
board << rectangle(10, y, 200, 10, style.withLineStyle(DashDotStyle));
y += 20;
board << rectangle(10, y, 200, 10, Color::Black, Color::Gray, 0.1, DashDotDotStyle);
y += 20;
board.setLineStyle(DashDotDotDotStyle);
// board.drawArrow( 10, y, 200, y );
board << rectangle(10, y, 200, 10, Color::Black, Color::Gray, 0.1, DashDotDotStyle);
y += 20;
board.setLineStyle(SolidStyle);
// board.drawArrow( 10, y, 200, y );
board << rectangle(10, y, 200, 10, Color::Black, Color::Red, 0.1, SolidStyle);
y += 20;
board.saveEPS("line_style.eps");
board.saveFIG("line_style.fig");
board.scaleToWidth(25, UseLineWidth);
board.saveSVG("line_style.svg", PageSize::BoundingBox, 0.0, Unit::Centimeter);
}