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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 1,638
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,638
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,638
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.