Board 0.9.6
examples/images.cpp
#include <Board.h>
using namespace LibBoard;
int main(int, char *[])
{
Board board;
#if (BOARD_HAVE_MAGICKPLUSPLUS == 1)
Tools::notice << "Magick++ is available" << std::endl;
Image michel("../resources/mont_saint_michel.jpg", 0, 0, 200);
Polyline rectangle = LibBoard::rectangle(michel.boundingBox(IgnoreLineWidth), Color::Red, Color::Silver, 1);
Group g;
g << rectangle;
g << michel;
board << tiling(g, Point(0, 0), 5, 4, 0.0, UseLineWidth);
ShapeList avatars;
Image avatar("../resources/avatar.png", 0, 0, 80);
avatar.rotateDeg(45);
avatars << tiling(avatar, Point(0, 0), 4, 4, 10.0, UseLineWidth);
avatars.moveCenter(board.center());
board << avatars;
#else
Tools::warning << "Magick++ not found" << std::endl;
Text text(10, -40, "Magick++ is required", Fonts::Helvetica, 10);
board << LibBoard::rectangle(text.boundingBox(LibBoard::IgnoreLineWidth).grow(5), Color::Red, Color::White, 1.0, SolidStyle, RoundCap, RoundJoin);
board << text;
#endif
board.saveEPS("images.eps", 20.0, 30.0, 2.0, Unit::Inch);
// board.saveEPS( "images.eps", PageSize::BoundingBox, 10.0, Board::UInche );
board.saveSVG("images_40x60cm.svg", 40.0, 60.0, 10.0, Unit::Centimeter);
board.saveFIG("images.fig", 20.0, 20.0, 2.0, Unit::Centimeter);
// board.saveFIG( "images.fig", PageSize::BoundingBox, 10.0, Unit::Centimeter );
board.scaleToWidth(25, UseLineWidth);
board.saveSVG("images.svg", PageSize::BoundingBox, 0.0, Unit::Centimeter);
}
Declaration of the Board class.
int main(int argc, char *argv[])
Definition arithmetic.cpp:16
Group text()
Definition board_font_text.cpp:17
Definition Board.h:55
Polyline rectangle(double left, double top, double width, double height, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin())
Definition Polyline.cpp:569
@ IgnoreLineWidth
Definition Style.h:58
Class for EPS, FIG or SVG drawings.
Definition Board.h:61
void saveFIG(const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const
Definition Board.cpp:636
void saveEPS(std::ostream &out, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter, const std::string &title=std::string()) const
Definition Board.cpp:539
void saveSVG(const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const
Definition Board.cpp:765
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a F...
Definition Group.h:40
Structure for a bitmap image shape.
Definition Image.h:41
Rect boundingBox(LineWidthFlag lineWidthFlag) const override
Definition Image.cpp:149
Struct representing a 2D point.
Definition Point.h:42
A polygonal line described by a series of 2D points.
Definition Polyline.h:38
A group of shapes.
Definition ShapeList.h:47
Shape & moveCenter(double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
Definition Shape.cpp:64
virtual Point center(LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
Definition Shape.cpp:59
Shape & rotateDeg(double angle, const Point &center)
Definition Shape.h:337
Shape & scaleToWidth(double w, LineWidthFlag lineWidthFlag)
Definition Shape.cpp:85
A piece of text.
Definition Text.h:40