Page 1 of 1

PureBasic Logo with the new library VectorDrawing()

Posted: Fri Oct 23, 2015 3:21 pm
by microdevweb
Create only with VectorDrawin (15 '+-), that not very nice logo, but it's just a exibition of the strong of this new library.

Image

Code: Select all

Enumeration 
      #MainForm
      #Img
      #MainImg
EndEnumeration
Procedure Draw()
      StartVectorDrawing(ImageVectorOutput(#Img))
      VectorSourceColor($FFFFFFFF)
      FillVectorOutput()
      ;{ Contour
      X=200
      Y=50
      MovePathCursor(X,Y)
      AddPathLine(350,30,#PB_Path_Relative)
      AddPathLine(-40,100,#PB_Path_Relative)
      AddPathLine(-25,0,#PB_Path_Relative)
      AddPathLine(-30,80,#PB_Path_Relative)
      AddPathLine(110,15,#PB_Path_Relative)
      AddPathLine(-40,110,#PB_Path_Relative)
      AddPathLine(-100,-10,#PB_Path_Relative)
      AddPathLine(-30,80,#PB_Path_Relative)
      AddPathLine(210,30,#PB_Path_Relative)
      AddPathLine(-40,80,#PB_Path_Relative)
      AddPathLine(-350,-40,#PB_Path_Relative)
      AddPathLine(70,-180,#PB_Path_Relative)
      AddPathLine(-100,-15,#PB_Path_Relative)
      AddPathLine(40,-110,#PB_Path_Relative)
      AddPathLine(100,15,#PB_Path_Relative)
      AddPathLine(30,-80,#PB_Path_Relative)
      AddPathLine(-180,-20,#PB_Path_Relative)
      AddPathLine(25,-85,#PB_Path_Relative)
      VectorSourceLinearGradient(200,50,800,600)
      VectorSourceGradientColor($FFFFFFFF,0.0)
      VectorSourceGradientColor($FF0000FF,0.2)
      VectorSourceGradientColor($FF2222B2,0.5)
      FillPath(#PB_Path_Preserve)
      VectorSourceColor($FF000080)
      StrokePath(2)
      ;}
      StopVectorDrawing()
EndProcedure
OpenWindow(#MainForm,0,0,800,600,"Logo Pb",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
CreateImage(#Img,800,600)
Draw()
ImageGadget(#MainImg,0,0,800,600,ImageID(#Img))
Repeat:Event=WaitWindowEvent():Until Event=#PB_Event_CloseWindow

Re: PureBasic Logo with the new library VectorDrawing()

Posted: Fri Oct 23, 2015 4:11 pm
by davido
@microdevweb,
Nice demonstration, thank you for sharing. :D