  //%attributes = {"lang":"en"} comment added and reserved by 4D.
	C_TEXT:C284($MethodName_T)
	$MethodName_T:=Current method name:C684
	
	  // ===================== Declare Variables ==================================
	  // method_parameters_declarations
	  // --------------------------------------------------------------------------------
	  // method_wide_constants_declarations
	  // --------------------------------------------------------------------------------
	  // local_variable_declarations
	
	C_LONGINT:C283($Ndx;$SOA;$PictRef_L)
	C_TEXT:C284($PictName_T)
	C_PICTURE:C286($Pict_G)
	C_POINTER:C301($Pict_P)
	C_BOOLEAN:C305($Destroy;$toOverWrite)
	
  // ====================== Initialize and Setup ================================

ARRAY LONGINT:C221($PictRef_aL;0)
ARRAY TEXT:C222($PictName_aT;0)
$Destroy:=False:C215
$toOverWrite:=True:C214

  // NOT YET
  // CONFIRM("Do you want to clear all picture exported ?")

If (ok=1)
	$Destroy:=True:C214
End if 

PICTURE LIBRARY LIST:C564($PictRef_aL;$PictName_aT)
$SOA:=Size of array:C274($PictRef_aL)

  // ======================== Method Actions ==================================

If ($SOA>0)
	
	  // request the path to create destination folder
	  // {HostDatabase}/Ressources/QS_Toolbox_export_library
	
	$path_t:=Get 4D folder:C485(Current resources folder:K5:16)+"QS_Toolbox_export_library"+Folder separator:K24:12
	
	If (Not:C34(Test path name:C476($path_t)=Is a folder:K24:2))
		CREATE FOLDER:C475($path_t;*)
	End if 
	trace
	For ($Ndx;1;$SOA)  // for each picture
		
		$PictRef_L:=$PictRef_aL{$Ndx}
		$PictName_T:=$PictName_aT{$Ndx}
		
		If ($PictName_T#"")
			
			GET PICTURE FROM LIBRARY:C565($PictRef_aL{$Ndx};$Pict_G)
			$Pict_P:=->$Pict_G  // passage of a pointer
			$Filename:=$path_t+$PictName_T+".png"
			CONVERT PICTURE:C1002($Pict_G;".png")  // conversion to png
			TRANSFORM PICTURE:C988($Pict_G;Transparency:K61:11;0x00FFFFFF)
			
			If ((Test path name:C476($Filename)=Is a document:K24:1) & (Not:C34($toOverWrite)))
				
				CONFIRM:C162("A picture file already exist.\nDo you want to overwrite for all of them ?")
				
				If (OK=0)  // clic on No
					$toOverWrite:=False:C215
				End if 
				
			End if 
			
			If ($toOverWrite)
				WRITE PICTURE FILE:C680($Filename;$Pict_G;"PNGf")
			End if 
			
			$Pict_G:=$Pict_G*0
			
		//	If ((Get document size:C479($Filename)>0) & ($Destroy))
		//		REMOVE PICTURE FROM LIBRARY:C567($PictRef_L)
		//	End if 
			
		End if 
	End for 
	
	SHOW ON DISK:C922($path_t)  // display the folder
	
Else 
	
	ALERT:C41("The picture library is already empty.")
	
End if 
