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) {
        super.onCreate(savedInstanceState);
        setContentView(new SampleView(this));
       
       
       
    }
   
    private static class SampleView extends View
    {         
         public SampleView(Context context)
         {
              super(context);

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

Top

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

Who is online

Users browsing this forum: Exabot [Bot] and 8 guests