DrawVectorImage()

Syntax

DrawVectorImage(ImageID [, Alpha [, Width.d, Height.d]])
Description
Draw the specified image directly to the vector drawing output.

The image will be drawn at the location of the path cursor. The cursor will be moved to the location of the bottom/right corner of the image after the image is drawn.

Parameters

ImageID (optional) Specifies the image to draw. Use the ImageID() function to get this value from an image.
Alpha (optional) Specifies an optional alpha transparency to apply to the image. This transparency is applied in addition to any transparent pixels already present in the image. The default is value is 255 (no additional transparency).
Width.d, Height.d (optional) Specifies an optional with and height for the image. If no width and height are specified, then the dimensions of the source image (in pixels) are converted into the unit of the vector drawing output and used (i.e. the image has its original size).

Return value

None.

Example

  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")

    If StartVectorDrawing(CanvasVectorOutput(0))
    
      MovePathCursor(50, 50)
      DrawVectorImage(ImageID(0), 127)
      
      MovePathCursor(75, 75)
      DrawVectorImage(ImageID(0), 127, ImageWidth(0) / 2, ImageHeight(0))

      MovePathCursor(120, 0)
      RotateCoordinates(120, 0, 35)
      DrawVectorImage(ImageID(0), 127)
    
      StopVectorDrawing()
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf

See Also

MovePathCursor(), PathCursorX(), PathCursorY(), VectorSourceImage()

Supported OS

All

<- DotPath() - VectorDrawing Index - DrawVectorParagraph() ->