I want to horizontally scroll an image (EKG.jpg) of an ECG (Electrocardiodiagram) in a loop, but how?
Yes, it is a static ECG image to scroll non-stop across the screen (restart when it reaches the end)
I can hardly imagine a true oscilloscope display effect of a free-running cardiograph, without the use of a timer.
What I understood is that he is using a static image (the cardiogram) which was saved previously from a real-time
cardiograph. So the main point and purpose of all this is to simulate the real-time flow of cardiograph. this means
the picture must be running freely without touching the screen or anything.
My previous suggestion involved a picture of the graph, but a single picture will, yes, run until completely disappears,
and then starts from the right side again.. of course this has nothing to do with real world cardiograph.. to solve this
problem and show the wave continuously, another identical image is used.. and the same timer event, the left property
of the second image must = to the left + width properties of the first image, so it can show like it is stitched to it..
And then by one single trick we can stitch the left property of the first image to follow the second image... I think
this is where real test must begin because theory only can not cover everything.
The link i posted shows code that will scroll an image in a loop - wrapping the left or right edges for seamless scrolling.
You'd have to remove all the touch detection code and replace it with code that runs on a Timer Tick event...
This is how I did it, and the result was a seamless scrolling of the EKG picture from right to left.
Sub Settings_EKG
ImageViewEKG1.Bitmap=LoadBitmap(File.DirAssets,"sr001.jpg")
ImageViewEKG2.Bitmap=LoadBitmap(File.DirAssets,"sr001.jpg")
a=0
b=400
ImageViewEKG1.Left=a
ImageViewEKG2.Left=b
timer_EKGloop.Initialize("timer_EKGloop", 25)
timer_EKGloop.Enabled = True
End Sub
Sub timer_EKGloop_tick
If a=-400 Then a=400
ImageViewEKG1.Left=a
a=a-5
If b=-400 Then b=400
ImageViewEKG2.Left=b
b=b-5
End Sub