Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to rotate a selection ? #192

Open
djs45 opened this issue Oct 12, 2022 · 1 comment
Open

How to rotate a selection ? #192

djs45 opened this issue Oct 12, 2022 · 1 comment

Comments

@djs45
Copy link

djs45 commented Oct 12, 2022

Hello.
I have a problem with the API :

I make a selection in the document with script :
app.activeDocument.selection.select(sel_area, ps.SelectionType.ReplaceSelection, 0, False)
Work !

I want to rotate this selection but I need 2 argument and I can't set anchorposition (I want middlecenter) :
app.activeDocument.selection.rotate(20 , ????? )
How can I set anchorposition please ?

Many thanks in advance

Sébastien

@loonghao
Copy link
Owner

@djs45 Please try the below codes

from photoshop import Session


with Session() as ps:
    app = ps.app
    doc = app.activeDocument
    doc.selection.rotate(90, ps.AnchorPosition.MiddleCenter)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants