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
tnavabothu
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

Please use plain text.
Developer
Zmey
Posts: 1,511
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

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
Please use plain text.
Contributor
tnavabothu
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. 

Please use plain text.
Developer
slashkyle
Posts: 818
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Telus

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

Please use plain text.
BlackBerry Development Advisor
IsaacGordezky
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

Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
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.
Please use plain text.
Developer
micaklus
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
Please use plain text.
Contributor
tnavabothu
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.

Please use plain text.