Connecting Tech Pros Worldwide Help | Site Map

how to draw a dotted line???

Newbie
 
Join Date: Jan 2007
Posts: 4
#1: Jan 24 '07
Hi,
I want to draw a dotted line.So how to colour the pixel with distance?(like ..... )
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Jan 24 '07

re: how to draw a dotted line???


You'll have to give more details than that.

I assume you are referring to your previous problem with drawing graphics using javascript.

See the documentation. It describes how to draw dotted lines by setting the stroke:
Expand|Select|Wrap|Line Numbers
  1. jg.setStroke(Stroke.DOTTED);
Newbie
 
Join Date: Jan 2007
Posts: 4
#3: Jan 24 '07

re: how to draw a dotted line???


Thanks.I would like to colour the pixels with distance maintaining.But according to the library width of dotted lines is always 1 pixel.So it also becomes same as a line.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Jan 24 '07

re: how to draw a dotted line???


I'm sorry I don't quite understand what you mean by "colour pixels" and "distance maintaining"? If you set the colour, it should be a different colour from black. The documentation does indeed say 1 pixel for a dotted line. I'm afraid you can't change that unless you edit the actual Javascript library functions, but I would advise against that.

What do you mean by saying that it appears like a line? The difference is that it is dotted. If you draw them both side by side, the line with 1 pixel thickness is noticeably darker than the dotted line.
Reply