Android draw on Canvas

44 views
Skip to first unread message

nadi...@gmail.com

unread,
Aug 17, 2017, 12:32:00 PM8/17/17
to skia-discuss
Hello,

Is there any starting example I can use to draw on Android View (Canvas).

Or at least any points, tips or directions I can use.

Derek Sollenberger

unread,
Aug 17, 2017, 12:39:45 PM8/17/17
to skia-discuss
Are you trying to do something you can't do with the Canvas API in the Android SDK?  If so, then depending on what you are trying to do the approach could be different.  Can you provide a little context for what you need to do?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

nadi...@gmail.com

unread,
Aug 17, 2017, 12:47:47 PM8/17/17
to skia-discuss

Thank you for ur response .... I have a ready code for rendering I'm using in my library under windows, which I'm using SKIA for drawing (C++), so I would like to use the same code for Android as well.

Derek Sollenberger

unread,
Aug 17, 2017, 2:18:43 PM8/17/17
to skia-discuss
As a first step you would need to build Skia as a static/shared lib so that it can be packaged in your application's APK.  Then you would need to create an application that uses either a SurfaceView (software rendering) or a GLSurfaceView (gpu rendering), then JNI into your native code that has Skia linked in.

I glossed over a lot of details and you can see our platform_tools/android/apps/viewer for an example of an application that uses a GLSurfaceView to render content.  It written to be used by our development team and as such it may be too complex to be of much use as sample code.
Reply all
Reply to author
Forward
0 new messages