Skip to content

How to draw in xtd? #238

Closed Answered by gammasoft71
ghost asked this question in Q&A
Oct 6, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

The following example shows how to draw a sine wave on a form.

#include <xtd/drawing/pen>
#include <xtd/forms/application>

using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;

auto main()->int {
  const auto sins = std::vector<point> {{10, 110}, {20, 148}, {30, 181}, {40, 202}, {50, 210}, {60, 202}, {70, 181}, {80, 148}, {90, 110}, {100, 72}, {110, 39}, {120, 18}, {130, 10}, {140, 18}, {150, 39}, {160, 72}, {170, 110}, {180, 148}, {190, 181}, {200, 202}, {210, 210}, {220, 202}, {230, 181}, {240, 148}, {250, 110}, {260, 72}, {270, 39}, {280, 18}, {290, 10}, {300, 18}, {310, 39}, {320, 72}};
  auto form1 = form::create("Sine wave");
  form1.client_size({330, 220}…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ghost
Comment options

@ghost
Comment options

@gammasoft71
Comment options

Answer selected by gammasoft71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
1 participant