Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OSD Line from A to B
#1
I'd like to draw a line on the screen from one point to another.. So you could once click some where and that would be the start point. Then you click another place and that would be the end point. Then it draws a line between them.

I tried to do it, but I didn't manage to get it working well..

test:
Code:
Copy      Help
type OSDCOLORANDBORDER color border
OSDCOLORANDBORDER a
a.color=ColorFromRGB(255 0 0)
a.border=2

int px = xm
int py = ym
1
OnScreenDraw px py xm-px ym-py &OSD_line &a
10

OSD_line:
Code:
Copy      Help
function hwnd hdc cx cy OSDCOLORANDBORDER&a
int hpen oldpen
;create/select pen and draw rectangle
hpen=CreatePen(0 a.border a.color); oldpen=SelectObject(hdc hpen)
LineTo hdc, cx, cy
DeleteObject SelectObject(hdc oldpen)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)