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

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

 



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 
                                             filename 
                                             FALSE 
                                             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.
_______________________________________________
gimp-developer-list mailing list
gimp-developer-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gimp-developer-list


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux