How do I change the thickness of line in LineXY()?

Just starting out? Need help? Post your questions and find answers here.
marvin
User
User
Posts: 35
Joined: Sun Jul 18, 2004 1:43 am

How do I change the thickness of line in LineXY()?

Post 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?
Fred
Administrator
Administrator
Posts: 18254
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
marvin
User
User
Posts: 35
Joined: Sun Jul 18, 2004 1:43 am

What function please?

Post 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
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post 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.
regards,
benny!
-
pe0ple ar3 str4nge!!!
Post Reply