Windows Application that can support stylus writing

I am trying to develop a windows app that will run on windows 10 tablets. It needs to have facility where customer can write using stylus and can save that image. What would be the best approach to achieve this requirement.

Also i need a suggestion for platform. Can i achieve this using typical windows forms application with C# or should i go for WPF windows application ?

Please provide some code for stylus writing.

Windows Application that can support stylus writing

Angular variable not binding to view

First off, not my code – helping a friend.
Second, I understand the concepts here, it must just be a dumb typo I’m missing…

Anyways:

I have an Angular/Onsen app that has an image that is put into a HTML5 canvas tag, and as I mouse over the canvas, I am picking the colour of the pixel I am on…

The view is pretty simple:

  <ons-template id="live.html">
    <ons-page ng-controller="LiveController">
      <ons-toolbar>
        <div class="left">
          <ons-toolbar-button ng-click="menu.toggle()">
            <ons-icon icon="ion-navicon" size="28px" fixed-width="false"></ons-icon>
          </ons-toolbar-button>
        </div>
        <div class="center">Live Camera</div>
      </ons-toolbar>



      <canvas id="canvas" width="100" height="100"></canvas>

      <p style="text-align:center;margin-left:auto;margin-right:auto;width:75px;padding:10px;border:1px solid black;">#{{hex}}</p>

    </ons-page>
  </ons-template>

read more

Angular variable not binding to view

First off, not my code – helping a friend.
Second, I understand the concepts here, it must just be a dumb typo I’m missing…

Anyways:

I have an Angular/Onsen app that has an image that is put into a HTML5 canvas tag, and as I mouse over the canvas, I am picking the colour of the pixel I am on…

The view is pretty simple:

  <ons-template id="live.html">
    <ons-page ng-controller="LiveController">
      <ons-toolbar>
        <div class="left">
          <ons-toolbar-button ng-click="menu.toggle()">
            <ons-icon icon="ion-navicon" size="28px" fixed-width="false"></ons-icon>
          </ons-toolbar-button>
        </div>
        <div class="center">Live Camera</div>
      </ons-toolbar>



      <canvas id="canvas" width="100" height="100"></canvas>

      <p style="text-align:center;margin-left:auto;margin-right:auto;width:75px;padding:10px;border:1px solid black;">#{{hex}}</p>

    </ons-page>
  </ons-template>

read more

How do I exit a loop in C++ without using break?

I’m writing a code to swap integers in an array and I want to know how I can exit a loop without using a break statement and keeping my logic consistent. Here is my code below:

int swapped = 0;
                if (arrays[0][first] % 2 == 0)
                {
                        cout << arrays[0][first] << " is odd " << endl;
                        for (int i = 1; i < arraycount; ++i)
                        {
                                for (int j = 1; j < arrays[i][0] + 1; ++j)
                                {
                                        if (arrays[i][j] % 2 != 0)
                                        {
                                                int temp = arrays[i][j];
                                                cout << "Array #" << 1 << " value " << arrays[0][first] << " swapped with "
                                                        << "Array #" << i << " value " << temp;

                                                arrays[i][j] = arrays[0][first];
                                                arrays[0][first] = temp;
                                                swapped = 1;
                                                break;
                                        }
                                }
                                if (swapped) {
                                        break;
                                }

read more

How do I exit a loop in C++ without using break?

I’m writing a code to swap integers in an array and I want to know how I can exit a loop without using a break statement and keeping my logic consistent. Here is my code below:

int swapped = 0;
                if (arrays[0][first] % 2 == 0)
                {
                        cout << arrays[0][first] << " is odd " << endl;
                        for (int i = 1; i < arraycount; ++i)
                        {
                                for (int j = 1; j < arrays[i][0] + 1; ++j)
                                {
                                        if (arrays[i][j] % 2 != 0)
                                        {
                                                int temp = arrays[i][j];
                                                cout << "Array #" << 1 << " value " << arrays[0][first] << " swapped with "
                                                        << "Array #" << i << " value " << temp;

                                                arrays[i][j] = arrays[0][first];
                                                arrays[0][first] = temp;
                                                swapped = 1;
                                                break;
                                        }
                                }
                                if (swapped) {
                                        break;
                                }

read more