Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drawing a line on a rectangle
#2
Add line drawing code to OSD_BRect. See how OSD_LineProc does it.

Function OSD_BRect
Code:
Copy      Help
function hwnd hdc cx cy param
int hpen oldpen hbrush oldbrush oldfont
int x0 y0 ipen
ipen=8
x0=5; y0=5

hbrush=CreateSolidBrush(14614245); oldbrush=SelectObject(hdc hbrush)
hpen=CreatePen(0 ipen 14614245); oldpen=SelectObject(hdc hpen)
RoundRect hdc x0+ipen y0+ipen cx-(2*x0)-ipen cy-(2*y0)-ipen 3 3

int hpen2 oldpen2
hpen2=CreatePen(0 2 0xff0000); oldpen2=SelectObject(hdc hpen2)
MoveToEx hdc 200 200 0 ;;set current position
LineTo hdc 300 300
DeleteObject SelectObject(hdc oldpen2)

DeleteObject SelectObject(hdc oldbrush)
DeleteObject SelectObject(hdc oldpen)
ret


Messages In This Thread
Drawing a line on a rectangle - by ssimop - 03-18-2020, 08:37 PM
RE: Drawing a line on a rectangle - by Gintaras - 03-18-2020, 09:21 PM
RE: Drawing a line on a rectangle - by ssimop - 03-18-2020, 09:36 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)