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

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
Zmey
Posts: 1,515
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
Contributor
tnavabothu
Posts: 48
Registered: ‎08-07-2013
My Device: z10

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
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

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
IsaacGordezky
Posts: 57
Registered: ‎10-04-2012
My Device: developer

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
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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
micaklus
Posts: 35
Registered: ‎12-20-2012
My Device: Limited Edition Z10

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

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.