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.

Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

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.

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. Smiley Happy

 

BlackBerry Certified Cascades Developer
Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: Signature Capture

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