I know too little about B4X to make a useful comment. I will study and try B4XView. I imagine that rotational movement is slow for the CPU because of complex calculations (sine, cosine) in compare to a movement in straight line.
I looked at B4XView and it looks like it will be much faster because only the pixels of the needle are drawn. My needle is a bitmap of 90000 pixels and it takes much longer to redraw. If in the future I'll need more than one dial I will use B4XView or draw the needle on minimal size rectangle. Thanks for your hint.
Actually it just has to use the "expensive" functions a few times, basically to work out where the corners move to, and then after that it's 99.9% adds, and a good half of those are add-ones ie increment. Plus AFAIK every phone's got a GPU nowadays, and rotation is one of the tasks that can be offloaded to that (by using the B4XView.Rotation property)
edit: you can probably even do PaneWithNoRotationProperty.As(B4XView).Rotation = ... but I can't test because el slacko here still hasn't gotten around to updating B4J
I fail to understand your explanation. If you have an image of a vertical line 1 pixel wide and you rotate it 45 degrees then the new line has only about 0.7 number of pixels as the vertical line. How do you decide which pixel stays and which goes?
0 ABCDEFGHIJ 0 A
1 1 B
2 2 D
3 3 E
4 4 G
5 5 H
6 6 J
The end coordinates of the destination line only needs to be calculated (ie using sine & cosine) once.
You'd have a source pixel pointer, starting at (0, 0), increment by (9/6, 0) each pass through the loop,
and a destination pixel pointer, starting at (0, 0), increment by (1, 1) each pass through the loop,
number of loops is number of destination pixels, which is max of horizontal and vertical lengths of destination line
Copying 10-pixel line to (rotated) 7-pixel line:
X Y Pixel X Y
========= ===== ===== ===== ===== =====
Increment 9/6 1 1 1
Start 0+0/6 0 A 0 0
1+3/6 0 B 1 1
3+0/6 0 D 2 2
4+3/6 0 E 3 3
6+0/6 0 G 4 4
7+3/6 0 H 5 5
Finish 9+0/6 0 J 6 6
Note that not only does this rotate the line, but by starting the destination line somewhere other than (0, 0) you can also translate/displace/move the line at the same time, plus the same transformation can scale/resize the line larger or smaller, at the same time... bonus!!!
Rectangular transformations are just repeated line transformations, with the starting and destination points incremented for each scan line.