Home > database >  How to draw a straight line with pb
How to draw a straight line with pb

Time:09-26

It is best to give an example: let me see, thank you

CodePudding user response:




Dw_1. Modify (& amp;
"The create line (=band Detail" + & amp;
"X1='y1=' x2='y2=' name=visible='1'" + & amp;
"Pen style='0'" + & amp;
"Pen width='5' pen. The color='33554432' background, mode='2' background. The color='1073741824')")

CodePudding user response:

Sweat, why use PB to draw a straight line?
Come with PB controls,,

CodePudding user response:

Create a line segment object, the start and end points of the line coordinates of the line

CodePudding user response:


String ls_modistr
Ls_modistr='create line (band=foreground x1="100" y1="200" x2="550" y2="800" name=l_2 visible="1" pen style="0" pen. Width="27" pen. Color="255" background. The mode="2" background. Color="1073741824")'
Dw_1. Modify (ls_modistr)

CodePudding user response:

 
//create a name for s_point structure
Global type s_point from structure
Long px
Long py
End type



 
//function declaration
The Function long GetDC (long hWnd) LIBRARY "user32. DLL
"The Function long CreatePen (int PenStale, int Widths, long a ColorRef) LIBRARY "GDI32. DLL
"The Function long SelectObject (long hDC, long hGDIObj) LIBRARY "GDI32. DLL
"The FUNCTION Boolean MoveToEx (ulong HWND, long wx, long wy, ref s_point prepos2) LIBRARY "Gdi32. DLL
"The Function long LineTo (long HDC, long xpos, long ypos) LIBRARY "gdi32. DLL
"

 
//draw the red line
Long ll_dc, ll_Pen
S_point str_point

Ll_dc=getdc (handle (the parent))
Ll_Pen=CreatePen (0, 1, RGB (0, 255))
SelectObject (ll_dc ll_pen)
Movetoex (ll_dc, 0, 100, str_point)
The LineTo (ll_dc, 400100)

CodePudding user response:

Nothing more than the above methods
  • Related