Page 1 of 1

Skin any Image with any Path

Posted: Sat Aug 28, 2021 7:02 am
by RASHAD
Hi
With PB you are Safe :mrgreen:

Code: Select all

If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CanvasGadget(0, 0, 0, 400, 200)
  
  LoadImage(0, #PB_Compiler_Home + "examples/Sources/Data/PureBasicLogo.bmp")
  LoadImage(1, #PB_Compiler_Home + "examples/Sources/Data/Geebee2.bmp")
  
  CreateImage(2,128,128,32,#PB_Image_Transparent)
  StartVectorDrawing(ImageVectorOutput(2))
  AddPathCircle(64,64,64)
  ClipPath()
  MovePathCursor(0, 0)
  DrawVectorImage(ImageID(1),255)
  VectorSourceColor(RGBA(255, 255, 0, 255))
  AddPathCircle(64,64,64)
  StrokePath(10)
  StopVectorDrawing()
  
  CreateImage(3,128,128,32,#PB_Image_Transparent)
  StartVectorDrawing(ImageVectorOutput(3))
  AddPathEllipse(64,64,64,32)
  ClipPath()
  MovePathCursor(0, 0)
  DrawVectorImage(ImageID(1),255)
  StopVectorDrawing()
  
  StartVectorDrawing(CanvasVectorOutput(0))    
  MovePathCursor(0, 0)
  DrawVectorImage(ImageID(0), 255,400,200)
  
  MovePathCursor(10, 10)
  DrawVectorImage(ImageID(2), 255)
  
  MovePathCursor(200, 0)
  DrawVectorImage(ImageID(3), 255)
  
  StopVectorDrawing()
  FreeImage(1)
  FreeImage(2)
  FreeImage(3)
  
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

Re: Skin any Image with any Path

Posted: Mon Oct 11, 2021 9:27 am
by ar-s
Thanks for sharing.