Page 1 of 1
How do I change the thickness of line in LineXY()?
Posted: Mon Sep 13, 2004 6:04 am
by marvin
How do I change the thickness of line in LineXY()?
Anyone got an updated pen_tablet code found in the survival guide?
I was trying to draw a consistent line with it but got to draw dot series only, via pressure. However I was able to draw a continuous line with LineXY() but I don't know how to implement the pressure with it.
Can anyone help?
Posted: Mon Sep 13, 2004 9:11 am
by Fred
Unfortunately, there is no control over the thickness of the drawing functions in the standard commandset. May be you can try a third-part library like X2D (eXtended 2D) which may be has such feature.
What function please?
Posted: Tue Sep 14, 2004 3:55 am
by marvin
Okay I downloaded X2D and opened it up, and been trying to figure out what function to get thickness in my lines.
Can you specifically tell me what function could help me accomplish the changing of line thickness in LineXY() via pressure.
Thanks
Posted: Tue Sep 14, 2004 7:55 pm
by benny
@marvin:
If it is fine with you to use some WinApi you could use
CreatePen
to define logical drawing "pens". Have a look at the following test code
written by GPI:
Code: Select all
; Author: GPI
; Date: 04. October 2003
If CreateImage(0,400,400)
hDC=StartDrawing(ImageOutput())
pen=CREATEPEN_(#PS_Solid,20,RGB(255,255,255))
oldpen=getcurrentobject_(hDC,#obj_pen)
SelectObject_(hDC,pen)
Line(0,0,400,400)
SelectObject_(hDC,oldpen)
DeleteObject_(pen)
StopDrawing()
If OpenWindow(1,0,0,400,400,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Pen-Test")
If CreateGadgetList(WindowID())
ImageGadget(0,0,0,400,400,ImageID())
While WaitWindowEvent()<>#PB_Event_CloseWindow:Wend
CloseWindow(1)
EndIf
EndIf
FreeImage(0)
EndIf
For more example code have a search on
PureArea
Search for
CreatePen.