Skin any Image with any Path

Share your advanced PureBasic knowledge/code with the community.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4622
Joined: Sun Apr 12, 2009 6:27 am

Skin any Image with any Path

Post 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
Egypt my love
User avatar
ar-s
Enthusiast
Enthusiast
Posts: 340
Joined: Sat Oct 06, 2007 11:20 pm
Location: France

Re: Skin any Image with any Path

Post by ar-s »

Thanks for sharing.
~Ar-S~
My Image Hoster for PB users
My webSite (french) with PB apps : LDVMULTIMEDIA
PB - 3.x / 5.7x / 6 - W11 x64 - Ryzen 7 3700x / #Rpi4

Code: Select all

r3p347 : 7ry : un71l d0n3 = 1
Post Reply