Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Drawing text on screen or pixmap buffer

Using NDK Beta 2.1

 

I want to draw some text on the screen and in a pixmap buffer.

 

Looked at the helloworld example and it takes ALOT of code just to print a simple text.

 

Is there any other way to do this without using the bbutil functions or OpenGL?

 

If I must use bbutil how would I draw text in offscreen buffer?

 

Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Drawing text on screen or pixmap buffer

Use either OpenGL or Qt.

>If I must use bbutil how would I draw text in offscreen buffer?

what do you mean?

Retired
Posts: 35
Registered: ‎08-01-2012
My Device: BB10 alpha-BB10 developer
My Carrier: T-Mobile

Re: Drawing text on screen or pixmap buffer

[ Edited ]

There is another option: using skia lib

 

https://github.com/blackberry/Skia

 

It also contain an example app for how to use skia lib on playbook.

( Note: you can not use QImage/QPainter to draw text at this moment, because you don't have access to QFont)

 

 

 

Warning:

Currently, the NDK has a bug for Skia lib, e.g.: it has pre-built Skia lib but does not include the header files. Thereby, you will need to build Skia lib by your self ( the github has the instruction how to build the lib in NDK) and bundle it with your app to override the one on the target.

 

 

 

 

Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Drawing text on screen or pixmap buffer

Thanks.  Seems to be alot of work just to do simple stuff.

 

Why can't we have more native graphics API like simple drawing funcs instead using 3rd party libraries?

 

I guess I will have to deal with Cascade.

 

 

 

Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Drawing text on screen or pixmap buffer


BGmot wrote:

Use either OpenGL or Qt.

>If I must use bbutil how would I draw text in offscreen buffer?

what do you mean?


The only way to draw text on the screen is with the bbutil functions or you write your own, correct?

 

I want to draw some text into a pixmap buffer and then display it on the screen.

 

 

Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Drawing text on screen or pixmap buffer

>I want to draw some text into a pixmap buffer and then display it on the screen.

Then I am afraid you have to write your own function drawing a text.