title: Is there function how to scale by values surfaceView in androidStudio?
body: <p>I have app where i take picture and then app draw a histogram of RGB colors. I have a problem displaying values.</p>
  <p><a href="https://i.stack.imgur.com/hxyb7.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I use path for drawing my RGB values, I can scale values by max and min but i don't know how to tell surfaceVIew to display only these values.</p>
  <pre><code>            Canvas canvas = surfaceHolder.lockCanvas();
              canvas.drawPath(redPath, mPaintR);
              canvas.drawPath(greenPath, mPaintG);
              canvas.drawPath(bluePath, mPaintB);
  </code></pre>
  <p>I fill in the path as follows:</p>
  <pre><code>            float screenWidth = surfaceView.getWidth();
              //float screenHight = surfaceView.getHeight();
              float offset = (float) (screenWidth / 256.0); //for x line
              
              Path redPath = new Path();
              redPath.moveTo(0,reds[0]);
              for (int i = 1; i &lt; reds.length; i++) {
                  redPath.lineTo(i * offset, reds[i]);
              }
  </code></pre>
  <p>Also problem in surfaceView is that starts drawing in [0,0] based on the attached photo and my attempts to draw the lines. Is there any solution to how to solve this?</p>
  <p>thank you for hints and ideas.</p>