BBjDrawPanel::drawLine

Description

In BBj 16.0 and higher, this method draws a line on the BBjDrawPanel from (x1,y1) to (x2,y2) using the current pen settings.

Syntax

Return Value

Method

void

drawLine(int x1, int y1, int x2, int y2)

Parameters

Variable

Description

x1

Horizontal position of upper left corner of the line.

y1

Vertical position of the upper left corner of the line.

x2

Horizontal position of the lower right corner of the line.

y2

Vertical position of the lower right corner of the line.

Return Value

None.

Remarks

This is equivalent to BBjDrawPanel::moveTo(x1,y1) followed by BBjDrawPanel::drawLine(x2,y2).

Example

rem ' BBjDrawPanel::drawLine
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "BBjDrawPanel::drawLine"
window! = sysgui!.addWindow(25,25,1250,300,title$,$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setTrack(0)
window!.setFont(sysgui!.makeFont("Arial",8,0))
drawpanel! = window!.getDrawPanel()
for i = 0 to 10
  x = i * 110
  w = (i+1) * 0.25
  drawpanel!.drawText(x+25,25,"setPattern("+str(i)+")")
  drawpanel!.drawText(x+25,50,"setLineWidth("+str(w)+")")
  drawpanel!.setPattern(i)
  drawpanel!.setPenWidth(w)
  color! = sysgui!.makeColor(rnd(127),rnd(127),rnd(127))
  drawpanel!.setPenColor(color!)
  adj = (i-5) * 5
  drawpanel!.drawLine(x+25,100,x+100,100+adj)
  drawpanel!.drawLine(x+25,150,x+100,150+adj)
  drawpanel!.drawLine(x+25,200,x+100,200+adj)
  drawpanel!.drawLine(x+25,250,x+100,250+adj)
next i
process_events
eoj:
release

See Also

BBjAPI

BBjSysGui

BBjWindow

BBjDrawPanel

LINE Mnemonic - Draw Line (SYSGUI)

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.