1

There are many curious things in android.

The thing that I want to ask is about Drawing with canvas.

when I override ondraw function ,

and the android gives me canvas to draw something in device.

I would like to get answer how canvas draw image or some figures internally.

If they need to draw something, use surface flinger or openglES or core graphics or any thing to swap image from back buffer to front buffer in device display.

I got some similar answers in this link Android GUI architecture - relation between Surface/view/window/canvas

But it's not really enough to understand..

Because I can't understand how they can initialize the device display and draw canvas in device display

I understand what relationship is in ViewRoot and View also surface.

Please let me know keys to draw something deeply about native layer.

Community
  • 1
  • 1
Sam Kim
  • 11
  • 2

2 Answers2

0

Here is a list of some of the Graphics API Demo Java source files:

  • AlphaBitmap
  • AnimateDrawables
  • Arcs
  • BitmapDecode
  • BitmapMesh
  • BitmapPixels
  • CameraPreview
  • Clipping
  • ColorFilters
  • ColorMatrixSample
  • Compass
  • CreateBitmap
  • DensityActivity
  • FingerPaint
  • Layers
  • MeasureText
  • PathEffects
  • PathFillTypes
  • Patterns
  • Pictures
  • DrawPoints
  • PolyToPoly
  • Regions
  • RoundRects
  • ScaleToFit
  • SensorTest
  • SurfaceViewOverlay
  • WindowSurface
  • Sweep
  • TextAlign
  • TouchPaint
  • Typefaces
  • UnicodeChart
  • Vertices
  • Xfermodes
Don Cowan
  • 1
  • 3
0

I strongly suggest you load the API Demos app into Eclipse and look through the Graphics demos. There are a large number of them and the code should give you insights into solutions to your problem.

To load the API Demos app, in Eclipse click File > New > Other > Android Sample Project.

Then select your build target such as Android 4.2.

Then from the list of sample apps select the API Demos app.

And finally click Finish.

There are over 300 demos in the app, so it can be difficult to navigate. You want to look in the Graphics section.

It's a little unclear from your description exactly what your issue is, but the API Demos cover a lot of territory and you should be able to find some code to help you out.

Don Cowan
  • 1
  • 3