Page 1 of 1

Use own brush for drawing !?

Posted: Thu Jun 23, 2005 10:30 am
by Ralf
i saw an API example where you can set the size of the brush you want use... for example draw a line with a size of 12 pixel!

Is there any way to draw a line for example with an own brush like...

00000
00000
11111
00000
00000


or

00100
00100
11111
00100
00100

0 = pixel transparent or black....
1 = pixel white

is something like this possible?

Posted: Thu Jun 23, 2005 10:00 pm
by Ralf
i found following example on the forum to change the brush size.. the brush looks like a circle!

Is there any way to set the brush to an object like "heart", "line" or whatever...? for example following as pen.. ??

00000000
00000000
00000000 ; 8 x 8 brush <<<< is this pattern as brush possible?
11111111
11111111
00000000
00000000
00000000
00000000


Code: Select all

Procedure Lin(x,y,x1,y1,Width,Color)
  hDC=GetDC_(WindowID())
  pen=CreatePen_(#PS_SOLID,Width,Color)
  hPenOld=SelectObject_(hDC,pen)
  MoveToEx_(hDC,x,y,0):LineTo_(hDC,x1,y1)
  DeleteObject_(pen)
  DeleteObject_(hPenOld)
EndProcedure

;_____________________________________________
_X=GetSystemMetrics_(#SM_CXSCREEN)-8 : _Y=GetSystemMetrics_(#SM_CYSCREEN)-68
OpenWindow(0,0,0,_X,_Y,#WS_OVERLAPPEDWINDOW | #WS_MAXIMIZE,"")

Lin(50,200,300,400,35,#red)
MessageRequester("","DONE",0)
[/quote]



I found something in the API Help... What about...

Code: Select all

HPEN ExtCreatePen(

    DWORD dwPenStyle,	// pen style 
    DWORD dwWidth,	// pen width 
    CONST LOGBRUSH *lplb,	// pointer to structure for brush attributes 
    DWORD dwStyleCount,	// length of array containing custom style bits 
    CONST DWORD *lpStyle 	// optional array of custom style bits 
   );

Type	Description
PS_GEOMETRIC	Pen is geometric.
PS_COSMETIC	Pen is cosmetic.


End cap	Description
PS_ENDCAP_ROUND	End caps are round.
PS_ENDCAP_SQUARE	End caps are square.
PS_ENDCAP_FLAT	End caps are flat.


Line join	Description
PS_JOIN_BEVEL	Joins are beveled.
PS_JOIN_MITER	Joins are mitered when they are within the current limit set by the SetMiterLimit function. If it exceeds this limit, the join is beveled.
PS_JOIN_ROUND	Joins are round.
[quote]


????? Can someone post an example please?[/quote]