I want to draw a signal waveform using the path.linTo method and a for loop as shown below.
public void drawSignal(Canvas c, PointF pos) // draws the signal onto the Canvas for each of the 12 channels
{
Paint paint = new Paint();
paint.setColor(Color.BLACK);
paint.setStyle(Style.STROKE);
Path path = new Path();
for (int i=0; i<ECGFilereader.numChannels; i++){
path.moveTo(wavePos[i].x, wavePos[i].y);
for (int chan = 0; chan<ECGFilereader.numChannels; chan++)
for (int m = 0; m < ECGFilereader.numSamples; m++){
path.lineTo(m+wavePos[i].x, signal[chan][m]+wavePos[i].y);
}
}
c.drawPath(path, paint);
However I would like to scale the graph so that each movement in the x-axis is only 1/5 of that of the y-axis, so that the length of the signal is effectively squashed horrizontally. Is it possible to do this by simply using floats somehow I do I need to actually create a larger canvas and scale it there?
Thanks in advance for any help.
err, either multiply the y-components by 5 or divide the x-components by 5 in both path.moveTo and path.lineTo?