Questions about drawing

klaus

Expert
Licensed User
Longtime User
I began to do some drawings on an Activity.


Questions:
  • Does there exist a Refresh for the activity ? Because when drawing a line nothing is displayed on the Activity. Adding a Butoon moving a Label shows the line.
  • There seems also be a clipping problem. With lines or bitmaps etc.
Attached a small test program.
  • By default 'Line' is selected.
  • Drawing a line, Click-Move-Release, nothing is displayed
  • Clicking onto the Button, the line is shown.
  • Run the program again.
  • Select 'Bitmap'
  • Click the Button, a map is displayed.
  • Clicking the Button a second time, there is a clipping acording to the Label choosen to display the Angle.
  • Select 'Path'
  • Click on Button
  • The display is clipped around the button.
What am I missing or doing wrong ?

Best regards.
 

agraham

Expert
Licensed User
Longtime User
•Clicking onto the Button, the line is shown.
•The display is clipped around the button.

Actually it doesn't for me, either on the emulator or my device. However Activity.Invalidate is what you are missing to force the screen redraw. It is more efficient to use Invalidate2/3 to refresh just the area that you know has been drawn.
 

klaus

Expert
Licensed User
Longtime User
Thank you Andrew and Erel.

I wouldn't have thought that 'Invalidate' would generate a refresh.

I should have had a look at the Smiley sample, done now !

From what I see in the Smiley example, there are no Layers that could be used like the Forelayer in B4PPC with transparent.

Best regards.
 

klaus

Expert
Licensed User
Longtime User
@Andrew,
I was aware that the Android devices are only 'hand driven' and not with a stylus and that real drawing will not be possible. Trying to draw lines and circles was to see what could be done and how.

@Erel,
I will have a look at your suggestion with a panel.

Thank you and Best regards.
 

mjcoon

Well-Known Member
Licensed User
You will have to bear in mind that many Android devices, particularly the smaller ones, are/will be equipped with capacitive touch screens that can be used only with a finger tip, not a stylus, so drawing on them is going to be very imprecise.

Perhaps an emulator variant for those devices is needed which has a fuzzy mouse cursor which represents a finger-tip to scale and has an indeterminate hotspot...

Mike.
 
Top