Question on drawpoint

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

Question on drawpoint

Postby avivonet » Thu Jul 02, 2009 9:28 pm

I am drawing a large (tens of thousand) set of points on a canvas, each potentially with a different color. The screen
is displayed correctly but all the points show up simultaneously after the calculation completes.

How can I force each point to be displayed separately and not to wait till the end. So a user can see the progress of the calculation and potentially interact with the display.

The code is below, there are two nested loops, a while nested in a for loop, the drawPoint method is called at the end of the while before the reiteration of the for.

Is there any way to force drawPoint to display the point immediately?

Code: Select all
public void onCreate(Bundle savedInstanceState) {
        setContentView(new SampleView(this));
    private static class SampleView extends View
         public SampleView(Context context)

         protected void onDraw(Canvas canvas)
               Paint paint = new Paint();
               //put code here
               for loop
               while loop to calculate the points.
                { some code}
                 end of while
              int color = (0xffffff00) * count;
               canvas.drawPoint(fx, fy, paint);
               } end of for                                             
Posts: 5
Joined: Fri Apr 17, 2009 9:36 pm


Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests