Skip to main content
Known Participant
Mar 24, 2026 9:58 PM UTC
Question

How do you use ResizeCanvas in C#

I am trying to translate some jsx scripts I have to use the C# interop and I can’t seem to find an example of how to use the Document.ResizeCanvas function. In jsx there is a UnitValue object so you can specify the units to use. But the interop doesn’t seem to define this object.

How do I make sure it is using px, or whatever unit type I want to use?

    2 replies

    jane-e
    Community Expert
    Community Expert
    Mar 24, 2026 10:28 PM UTC

    ​@Chris2817953202q6 wrote: How do I make sure it is using px

     

    One thing you can do is to type the unit. For example, type 1200px or 6” or 200mm. Photoshop will convert to your current measurement system.

     

    You can also select the measurement system in the Resize Canvas dialog.

     

    Jane

    Translate
    Known Participant
    Mar 24, 2026 10:32 PM UTC

    Can you provide an example of the code to do what you are suggesting? I am not sure I follow the applicability to my question.

    Translate