PureBasic Logo with the new library VectorDrawing()

Share your advanced PureBasic knowledge/code with the community.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

PureBasic Logo with the new library VectorDrawing()

Post 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
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: PureBasic Logo with the new library VectorDrawing()

Post by davido »

@microdevweb,
Nice demonstration, thank you for sharing. :D
DE AA EB
Post Reply