4D v13

SVG_SET_CLIP_PATH

Home

 
4D v13
SVG_SET_CLIP_PATH

SVG_SET_CLIP_PATH 


 

SVG_SET_CLIP_PATH ( svgObject ; clipPathID ) 
Parameter Type   Description
svgObject  SVG_Ref in Reference of SVG element
clipPathID  Text in Name of clip path

The SVG_SET_CLIP_PATH command sets the clip path named clipPathID for the object passed in svgObject. An error is generated if svgObject is not a valid reference or if the clip path is not defined.

See Also: http://www.w3.org/TR/2001/REC-SVG-20010904/masking.html#EstablishingANewClippingPath

Defining a circular clip path that will then be assigned to an image:

  //Defining a circular clip path
 $Dom_clipPath:=SVG_Define_clip_path($Dom_SVG;"theClip")
 $Dom_circle:=SVG_New_circle($Dom_clipPath;150;100;100)
 
  //Creating a group
 $Dom_g:=SVG_New_group($Dom_SVG)
 
  //Inserting an image
 $Txt_path:=Get 4D folder(6)+"logo.svg"
 READ PICTURE FILE($Txt_path;$Pic_buffer)
 $Dom_picture:=SVG_New_embedded_image($Dom_g;$Pic_buffer)
 SVG_SET_ID($Dom_picture;"MyPicture")
 
  //Applying clip path to group
 SVG_SET_CLIP_PATH($Dom_g;"theClip")

The same image with a rectangular clip path with rounded corners:

  //Defining a rectangular clip path
 $Dom_clipPath:=SVG_Define_clip_path($Dom_SVG;"theClip")
 $Dom_rect:=SVG_New_rect($Dom_clipPath;5;10;320;240;10;10)
 
  //Creating a group
 $Dom_g:=SVG_New_group($Dom_SVG)
 
  //Inserting an image
 $Txt_path:=Get 4D folder(6)+"logo.svg"
 READ PICTURE FILE($Txt_path;$Pic_buffer)
 $Dom_picture:=SVG_New_embedded_image($Dom_g;$Pic_buffer)
 SVG_SET_ID($Dom_picture;"MyPicture")
 
  //Applying clip path to group
 SVG_SET_CLIP_PATH($Dom_g;"theClip")

 
PROPERTIES 

Product: 4D
Theme: Attributes
Number: 65900

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D v12

 
SEE ALSO 

SVG_Define_clip_path