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
Contributor
Posts: 48
Registered: ‎08-07-2013
My Device: z10
My Carrier: blackberry

how to draw a line in bb cascades

hi,

      i want to draw a line between two touched points in bbcascades,the thing i.m able to ge the points when the events happen like touch down and touch up.now i want to draw a line between these two points.is it possible.

 

 

thank you

Developer
Posts: 1,523
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: how to draw a line in bb cascades

Hi,
AFAIK, there's no easy way to do this. Possible approaches:

1. Drawing into QImage using QPainter. Converting QImage to Image for displaying. This will be slow if the image needs to be updated often.

2. Drawing new lines to a texture using OpenGL and rendering that texture using ForeignWindowControl.

Andrey Fidrya, @zmeyc on twitter
Contributor
Posts: 48
Registered: ‎08-07-2013
My Device: z10
My Carrier: blackberry

Re: how to draw a line in bb cascades

thanks for your reply,

 

    i'm new to bb can i know how to draw in a qimage and use them it. 

Developer
Posts: 825
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: how to draw a line in bb cascades

this is a knowledge base article on how to use qpainter to replicate images but you can easily take it and adjust it to draw just a line or nearly anything else you may need to draw

 

http://supportforums.blackberry.com/t5/Native-Development-Knowledge/Using-QImage-and-QPainter-to-Pre...

 

documentation on qpainter

http://harmattan-dev.nokia.com/docs/library/html/qt4/qpainter.html

 

http://qt-project.org/doc/qt-5.0/qtgui/qpainter.html

BlackBerry Development Advisor
Posts: 57
Registered: ‎10-04-2012
My Device: developer
My Carrier: none

Re: how to draw a line in bb cascades

If all you want is a simple line, you can achieve this with a container that has a background color and is translated and rotated to the correct location

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: how to draw a line in bb cascades

@IsaacGorezky, I like this... good outside the box thinking! :smileyhappy:


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 35
Registered: ‎12-20-2012
My Device: Limited Edition Z10
My Carrier: Telekom Slovenije

Re: how to draw a line in bb cascades

Use Divider for simple line :smileyhappy:

______________________________________________________________
Check my Apps http://appworld.blackberry.com/webstore/vendor/29747/?lang=en
Contributor
Posts: 48
Registered: ‎08-07-2013
My Device: z10
My Carrier: blackberry

Re: how to draw a line in bb cascades

hi,

 

     it is not to get a simple line,i'm developing an free hand drawing app,for that i'm using the touch events to recognise the touch points where the user touches on the screen.

 

     i have to use these n number of points to create and show what ever the user draws,my approach is that to connect, point by point by a line,so that it we can show what the user draw.

 

thanks all for your replies,please post me if there is another way to do this.