selection.py 835 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. from lazpaint import command, dialog
  2. if __name__ == "__main__":
  3. dialog.show_message("Library to access selection.")
  4. def load(file_name=None):
  5. command.send("FileLoadSelection", FileName=file_name)
  6. def save_as(file_name=None) -> str:
  7. return command.send("FileSaveSelectionAs?", FileName=file_name)
  8. def invert():
  9. command.send("EditInvertSelection")
  10. def deselect():
  11. command.send("EditDeselect")
  12. def copy():
  13. command.send("EditCopy")
  14. def cut():
  15. command.send("EditCut")
  16. def delete():
  17. command.send("EditDeleteSelection")
  18. def select_all():
  19. command.send("EditSelectAll")
  20. def fit():
  21. command.send("EditSelectionFit")
  22. def is_mask_empty() -> bool:
  23. return command.send("IsSelectionMaskEmpty?")
  24. def is_layer_empty() -> bool:
  25. return command.send("IsSelectionLayerEmpty?")
  26. def paste():
  27. command.send("EditPaste")