From dba885669c15b225d4a2310b4e70a5a2ffdddb96 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 1 May 2012 17:49:33 +0000 Subject: [PATCH] .Fixing svn directory structure git-svn-id: svn://ultimatepp.org/upp/trunk@4893 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- .../ScatterDraw_Demo/ScatterDraw_Demo.cpp | 37 +++++++++++++++++++ .../ScatterDraw_Demo/ScatterDraw_Demo.upp | 13 +++++++ examples/ScatterDraw_Demo/init | 6 +++ 3 files changed, 56 insertions(+) create mode 100644 examples/ScatterDraw_Demo/ScatterDraw_Demo.cpp create mode 100644 examples/ScatterDraw_Demo/ScatterDraw_Demo.upp create mode 100644 examples/ScatterDraw_Demo/init diff --git a/examples/ScatterDraw_Demo/ScatterDraw_Demo.cpp b/examples/ScatterDraw_Demo/ScatterDraw_Demo.cpp new file mode 100644 index 000000000..a0f2ea9ab --- /dev/null +++ b/examples/ScatterDraw_Demo/ScatterDraw_Demo.cpp @@ -0,0 +1,37 @@ +#include + +using namespace Upp; + +#include + + +CONSOLE_APP_MAIN +{ + Cout() << "\nScatterDraw_Demo"; + Cout() << "\n\nScatter painted to Image and saved to file"; + + ScatterDraw scatter; + Vector s1; + s1 << Pointf(10,14) << Pointf(20,25) << Pointf(30,29) << Pointf(40,24) << Pointf(50,36); + scatter.AddSeries(s1).Legend("Series 1").NoMark(); + + double x[] = {20, 30, 40, 50, 60}; + double y[] = {34, 45, 49, 44, 56}; + scatter.AddSeries(x, y, 5).Legend("Series 2").Stroke(5, Null).Dash(LINE_DASHED) + .MarkStyle().MarkWidth(12); + + scatter.FitToData(); + + scatter.SetTitle("ScatterDraw_Demo").SetTitleFont(SansSerif(14).Bold()); + scatter.SetLabelY("Temperature [ÂșC]").SetLabelX("Time [sec]").SetLabelsFont(SansSerif(12)); + scatter.SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(30).SetPlotAreaTopMargin(40).SetPlotAreaBottomMargin(50); + scatter.SetSize(Size(1000, 500)); + scatter.SetMode(ScatterDraw::MD_ANTIALIASED); + + String fileName = AppendFileName(GetDesktopFolder(), "Scatter.png"); + PNGEncoder().SaveFile(fileName, scatter.GetImage()); + + Cout() << "\n\nSaved '" << ToSystemCharset(fileName) << "'"; + Cout() << "\n\nPress key to end"; + getchar(); +} diff --git a/examples/ScatterDraw_Demo/ScatterDraw_Demo.upp b/examples/ScatterDraw_Demo/ScatterDraw_Demo.upp new file mode 100644 index 000000000..98847c01b --- /dev/null +++ b/examples/ScatterDraw_Demo/ScatterDraw_Demo.upp @@ -0,0 +1,13 @@ +description "ScatterDraw Demo. Sacatter without GUI\377"; + +uses + Core, + ScatterDraw, + plugin\png; + +file + ScatterDraw_Demo.cpp; + +mainconfig + "" = "SSE2"; + diff --git a/examples/ScatterDraw_Demo/init b/examples/ScatterDraw_Demo/init new file mode 100644 index 000000000..be63eeda5 --- /dev/null +++ b/examples/ScatterDraw_Demo/init @@ -0,0 +1,6 @@ +#ifndef _ScatterDraw_Demo_icpp_init_stub +#define _ScatterDraw_Demo_icpp_init_stub +#include "Core/init" +#include "ScatterDraw/init" +#include "plugin\png/init" +#endif