Skip to main content
Known Participant
March 24, 2026
Question

How do you use ResizeCanvas in C#

  • March 24, 2026
  • 1 reply
  • 29 views

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?

    1 reply

    jane-e
    Community Expert
    Community Expert
    March 24, 2026

    @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

    Known Participant
    March 24, 2026

    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.