I'm not sure what you really want to do but here's some information:
1/ While Android provides extensive graphics API to draw text and other things from Java, it doesn't have any equivalent thing for C/C++.
2/ However, it provides a way to access the pixel buffer of bitmap objects (see <android/bitmap.h> as distributed with the NDK for details).
As such, you have two options:
1/ If you want to do everything in C/C++, use the <android/bitmap.h> to access the pixel buffer of a given bitmap, and modifying the pixels directly there. This of course requires that you have your own graphics / text rendering library in your project. Access to installed font files might be problematic though, I'm not sure there is an official way to access them from native code (I guess using hard-coded paths might work, but this is fragile, i.e. OEMs can easily change the set of fonts installed on their system, as well as the location of said fonts).
2/ Use JNI to call the relevant Java APIs to draw text directly into whatever target Bitmap object you need.
Note that, alternatively, you could just write a little Java. In many cases, it will simply be a lot simpler than doing things in C/C++ anyway.
Hope this helps
On Tue, Mar 26, 2013 at 4:33 PM, Romain Rodriguez
<romai...@gmail.com> wrote:
Dear all,
I'm a new android developper, and I need to program a native application, in C language.
I have already build the native-plasma sample, end everything works great.
My need are :
Define some zones on my screen buffer.
Write text in theses zones.
define zones corresponding to my screen should be ok, but how can I write text easely to my screen buffer ?
Is any libraries or something to do that easely?
Or I have to define all letters in "pixel" ?
Thanks in advance
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.