Re: [Gimp-developer] [Script-fu] How to convert a path to a selection? (grafxuser)

The procedure returns a list containing a count and an array of path IDs. 

I would recommend converting this to a list using the R5RS function 'vector->list'. Mind that the "vector" in 'vector->list' is what Scheme chooses to call an array; it is completely unrelated to the GIMP concept of vectors/paths. To avoid confusion, I use the older "path" terminology for my user-defined functions and variables. 

(let ((paths (vector->list 
        (cadr (gimp-vectors-import-from-file image 
                                             scale-to-imagesize )))))
  ; we now have a list of 'paths' that have been imported.
  ; To select from the first path in the list, use the 'car' function
  (gimp-vectors-to-selection (car paths) 2 TRUE FALSE 0 0)

If more than one path has been imported, you could loop through the list of path IDs, adding each selection.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]