Hi,

Create a new Bitmap and Canvas then draw your path into the new Canvas
and use the associated Bitmap as your cache.

The code I wrote in the following may help -

http://groups.google.com/group/android-developers/browse_thread/thread/6aeed20525760f3/c44b305df3897427

Regards

On Oct 6, 12:26 pm, Felix <[email protected]> wrote:
> Hi,
>
> I am banging my head against the wall trying to create a Bitmap from a
> Path object (android.graphics.Path). Is there any way to do this? I've
> browsed through most of the classes now but can't seem to find any way
> to do it.
>
> Actually, what I have is a Path that consists of many cubic Bezier
> curves. It is really expensive to draw with canvas.drawPath(). So I
> figured that I could perhaps "cache" the Bitmap of this Path by
> converting the Path to a Bitmap once and then just drawing the Bitmap
> every time instead of calling canvas.drawPath().
>
> Is there any way to create a Bitmap from this Path?
>
> Or is there a smarter way to draw tha Path multiple times without
> having to recalculate all of the Beziers? For example, if I created a
> ShapeDrawable from PathShape from the Path, and just draw the
> ShapeDrawable objects every time, would that be more efficient than
> drawing the Path every time?
>
> Thanks very much in advance for your answers!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to