Board index » delphi » Need solution of described problem
MNS
![]() Delphi Developer |
Need solution of described problem2005-09-16 01:50:57 PM delphi58 I m drawing a line between to 2 controls. In which i set the width,color and mode of PEN. Here the default color is YELLOW and the TPen.Mode:= pmNotXor; Here i m facing a problem as i draw second line against same coordinates suppose as second line on the first line. Then that is not visible sue to its mode and if i draw the third line on that same line the becomes visible. I don't want to keep the pmBlack mode of pen. And in that case if i did't set the mode in this procedure problem is while drawing a line, the line becomes irregular shape more than defined width which is also not accpetable. So plz help in and post the solution if any one has. Below is the procedure to draw the line. procedure TFrmMain.DrawShape(TopLeft, BottomRight: TPoint; AMode: TPenMode;PingStaus:TPINGSTATUS); begin with Image.Canvas do begin Pen.Mode := AMode; if PingStaus=UNPING Then Image.Canvas.Pen.Color:=LINECOLOR_UNPING//clAqua Else if PingStaus=PINGALIVE Then Image.Canvas.Pen.Color:=LINECOLOR_PINGALIVE//clSilver Else if PingStaus=PINGDEAD Then Image.Canvas.Pen.Color:=LINECOLOR_PINGDEAD;//$00400080; Image.Canvas.MoveTo(TopLeft.X, TopLeft.Y); Image.Canvas.LineTo(BottomRight.X, BottomRight.Y); end; Invalidate; end; |