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: 19
Registered: ‎03-06-2014
My Device: blackberry z10 stl100-3
My Carrier: n/a

Signature Capture

Does anyone know how to create a signature capturing function? Basically something that will allow the user to doodle a signature with their finger on the screen of the phone and save it as a picture. I did some googling and the closest I got to a solution was some code for capturing finger strokes in a Rectangle element in QtQuick 2.0, sadly all I have to work with is QtQuick 1.1 with no Rectangle element support.

 

I was thinking of using a WebView instead and the html5 canvas element as a possible solution, but before I go down that avenue I'd like to see if someone has already discovered a functional solution.

BlackBerry Development Advisor
Posts: 158
Registered: ‎09-06-2010
My Device: Classic
My Carrier: Vodafone UK

Re: Signature Capture

If you're looking at a native/QML solution you might take a look at the QML control: ForeignWindowControl. It allows you to "punch" a hole through to the Screen Graphics Subsystem.

 

https://developer.blackberry.com/native/reference/cascades/bb__cascades__foreignwindowcontrol.html

 

Essentially it allows you to get a screen context and screen window from the underlying graphics system and then interact with it. You can use OpenGL ES for example and set up a rendering surface on it to draw and capture screen events.

 

There's a simple example here:

 

https://github.com/blackberry/Cascades-Samples/tree/master/helloforeignwindow

 

that demonstrates how to use that control.

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim
Developer
Posts: 108
Registered: ‎04-14-2013
My Device: BlackBerry Z30
My Carrier: Chunghwa Telecom

Re: Signature Capture

Hi!

 

I think using webview with Canvas is the simplest way to make your signature function work.

If you want more detail information, I can provide a sample project with Webview drawing wrapped in Cascades UI. :smileyhappy:

 

BlackBerry Certified Cascades Developer
BlackBerry Development Advisor
Posts: 158
Registered: ‎09-06-2010
My Device: Classic
My Carrier: Vodafone UK

Re: Signature Capture

I'd agree -- if you're not already familiar with OpenGL ES then there's a bit of a learning curve. 

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim