Page 1 of 1

bad outside,StartVectorDrawing() add mode

Posted: Sun Jun 12, 2016 4:18 am
by gurj
StartVectorDrawing() add mode
StartVectorDrawing(Output[,mode])
mode:
#pb_odd;Path is odd number
#pb_even;Path is even number
#pb_natural;Path is true natural number

current pb only as it is #pb_even, Example:
VectorSourceColor(RGBA(0, 0, 0, 255))
StrokePath(5)

StrokePath(5) as it is :
StrokePath(6),but:between 4 Path use RGBA(0, 0, 0, 255),outside 2 Path use RGBA(7F, 7F, 7F, 255)

if add mode:

#pb_odd:
StrokePath(4) as it is :
StrokePath(5),but:between 3 Path use RGBA(0, 0, 0, 255),outside 2 Path use RGBA(7F, 7F, 7F, 255)

#pb_natural:
StrokePath(a) is true a and true RGBA(0, 0, 0, 255)

Re: StartVectorDrawing() add mode

Posted: Tue Jan 17, 2017 10:00 am
by gurj
this code:
Line outside color isn't neat $ffeeddff and user can not flexibility, pb isn't pure. hope to no Line outside that color
code:

Code: Select all

If OpenWindow(0,0,0,500,400,"",#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
  If CreateImage(0,450,350,32,$ffffffff) And
     StartVectorDrawing(ImageVectorOutput(0))
  MovePathCursor(20,20):AddPathLine(400,270)
  VectorSourceColor($ffeeddff):StrokePath(18)
    MovePathCursor(20,20):AddPathLine(400,270)
  VectorSourceColor($ff0000ff):StrokePath(6)
  
 StopVectorDrawing()
 ImageGadget(0,20,20,450,350,ImageID(0))
  EndIf
 Repeat:Select WaitWindowEvent()
   Case #PB_Event_CloseWindow:Quit = 1
 EndSelect:Until Quit = 1
EndIf:End

Re: StartVectorDrawing() add mode

Posted: Tue Jan 17, 2017 11:16 am
by gurj
very bad outside:

Code: Select all

If OpenWindow(0,0,0,500,500,"",#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
 TrackBarGadget(1, 10,  10, 400, 20, 0, 400):TextGadget(2,410,  10, 400, 20,"")
 ss=37: SetGadgetState(1, ss)
 Gosub re
 Repeat:Select WaitWindowEvent()
    Case #PB_Event_Gadget:Select EventGadget()
     Case 1:ss=GetGadgetState(1):SetGadgetText(2,Str(ss))
    Gosub re:EndSelect
   Case #PB_Event_CloseWindow:Quit = 1
 EndSelect:Until Quit = 1
EndIf:End
re:
If CreateImage(0,500,500,32,$ffffffff) And
   StartVectorDrawing(ImageVectorOutput(0))
 MovePathCursor(20,20):AddPathLine(348,ss)
 VectorSourceColor($ffddddff):StrokePath(7)
 MovePathCursor(20,20):AddPathLine(348,ss)
 VectorSourceColor($ff0000ff):StrokePath(1)
 
 StopVectorDrawing()
 ImageGadget(0,20,30,450,350,ImageID(0))
EndIf:Return