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

Java Development

Reply
Developer
Developer
Posts: 324
Registered: ‎05-26-2009
My Device: Not Specified
Accepted Solution

drawLine thicker than 1 pixel.

Hi,

 

I want to draw a line between two points, that is thicker than 1 pixel.

 

Graphics::drawLine does not have any parameters to control the thickness of the line/stroke.

 

I have also looked at Graphics::drawFilledPath. But  it seems to be provided to daw filled polygons etc. 

 

I would really appreciate any pointers to resolve this.

 

Thanks,

 

-MB.

Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: drawLine thicker than 1 pixel.

Hi,

 

You can use drawFillRect to solve this thing or try drawing two line one after the other.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Developer
Developer
Posts: 324
Registered: ‎05-26-2009
My Device: Not Specified

Re: drawLine thicker than 1 pixel.

Can you please elaborate on this?

How would you draw  a thick line connecting points (0, 0) and (100, 100)  using drawFillRect?

 

--MB.

Highlighted
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: drawLine thicker than 1 pixel.

Hi,

 

I think you did not mentioned that you want to draw a diagonal line , you can call drawline() two times

 

drawLine(0,0,100,100);

drawLine(0,1,100,101);

 

I think this should solve your problem.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Developer
Developer
Posts: 324
Registered: ‎05-26-2009
My Device: Not Specified

Re: drawLine thicker than 1 pixel.

Thanks, looks like this should do it.

 

--MB.