Hi all,
I've worked on the project this weekend and I reproduced it on small projects to know how to solve the problem.
On Test3 project there is all relevant code involved to find a solution, but here without success
.
As you can see from my class, I initialize the ScrollView2D with very big dimensions because I need to zoom the drawings, this actually is 3500x3500 pixels, then I initialize the Canvas on ScrollView2D.Panel, this way I can scroll the canvas. As discussed with Erel I think that redraw it every line can slow down the process, not sure because not tried but already it execute slow and I need to optimize the speed execution, on my Nexus 7 2013 works 20 times slower than an old AMD Athlon XP2600 single processor PC with 1GB of ram, even I need to increase ScrollView2D panel, but it recognize max 3500x3500 pixels, if I put 3600x3600 it do not show at all, I even tried to increase Heap space on Manifest, but no, it do not show.
Another issue is that I need to scroll the ScrollView2D with this code but it do not scroll:
mScrollPane.VerticalScrollPosition = 900
mScrollPane.Panel.Invalidate
Anyway, to stay not offtopic I've attacked 3 simple projects to reproduce that discussed on this thread:
Test1 - On this project I've tried Semen suggestions and modified a bit his code
Test2 - On this project I show how I use my viewer class to simulate 3D on 2D Canvas
Test3 - On this project I've tried to solve the problem but without success
NOTE: On Test2 scroll down manually the vertical ScrollView2D to see the drawings.
@Semen Matusovskiy your example code works well, but on the Service I need to draw with my class and I can't declare it because contains Activity objects, I can't draw on mutable bitmap without make 3D calculations that my class do. Even your code draws only while the Activity stay paused, I need to draw both, while is paused on mutable bitmap, then when it resumes draw a mutable bitmap on it and use it as start point to continue drawing on it as if app do not goes on pause state at all.
@Erel following your code example, I've tried to wrap my class to an Object on the Service (Test3) instead of a Canvas, I can see the class methods on Autocomplete, but I can't use it because the class must be initialized and require an Activity or Panel as initialization argument.
You said that I've to split my class on 2 classes, but I do not know how to do this, any sub references to Activity Objects (Canvas).
Do I need to use mutable bitmap and ImageView on it?
On Test3 project as I explained there is all relevant code, please, can you modify a bit so I can know how it works?
Many thanks for yours precious time and help, I want to put a [SOLVED] Attribute to this thread.