Pixels from path objekt

  • Replies:1
Harri E
  • Forum posts: 3

Apr 10, 2012, 9:20:45 PM via Website

Hello,

i am drawing a path object on a canvas. (canvas.drawPath)
WHat i am trying is to get a list of pixels that a drawn with that.

I think somwhere behind the drawPath method there is a determination of the pixels to be drawn on screen.
is there a way to get such a list.

Thanks for your help


Kind regards
Harri E.

Reply
Jeremiah
  • Forum posts: 775

Apr 10, 2012, 11:40:20 PM via Website

Are you trying to get the x,y coordinates of each pixel that will be drawn by the path? I'm not sure but I think you can use an android.graphics.PathMeasure to do this. Try creating a PathMeasure with your path, and using PathMeasure.getMatrix(). http://developer.android.com/reference/android/graphics/PathMeasure.html#getMatrix(float, android.graphics.Matrix, int)

You can use canvas.clipPath to set the drawable area of the canvas to your path. I'm not sure what exactly your trying to do?

Reply