# 그림 확대/축소비율 컨트롤

**URL:** https://forum.developer.hancom.com/t/topic/3155
**Category:** 한글 오토메이션
**Created:** [6월 8, 2026, 4:41오전 UTC](https://forum.developer.hancom.com/t/topic/3155 "2026-06-08T04:41:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![YnRqQY](https://avatars.discourse-cdn.com/v4/letter/y/ec9cab/32.png) [@YnRqQY](https://forum.developer.hancom.com/u/YnRqQY)
#### Post date: [6월 8, 2026, 4:41오전 UTC](https://forum.developer.hancom.com/t/topic/3155/1 "2026-06-08T04:41:15Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/hancom_dev_forum/original/2X/a/a8bd2a8083aa490e4c74071e1bbbd352dd3ba7f0.png)

안녕하세요. 현재 Python에서 한글 프로그램을 제어하는 프로그램을 개발 중입니다.

그림을 삽입한 후 모든 그림의 확대/축소 비율을 일정한 크기로 설정하고 싶은데, 저 부분이 아무리 실행해도 변환이 안되더라구요..

PictureToOriginal, WidthHeight 변환 모두 해봤는데 소용이 없었습니다. 혹시 해결책 아시는 분 계실까요?

```auto
act_shape = hwp.CreateAction("ShapeObjDialog")
pset_shape = act_shape.CreateSet()
act_shape.GetDefault(pset_shape)

pset_shape.SetItem("Width", (int)(pset_shape.Item("Width")*11.8/12.7))
pset_shape.SetItem("Height", (int)(pset_shape.Item("Height")*11.8/12.7))
act_shape.Execute(pset_shape)

```

---

<div class="post-metadata">

### Author: ![ygyoun](https://avatars.discourse-cdn.com/v4/letter/y/b4bc9f/32.png) [@ygyoun](https://forum.developer.hancom.com/u/ygyoun)
#### Post date: [6월 16, 2026, 1:27오전 UTC](https://forum.developer.hancom.com/t/topic/3155/4 "2026-06-16T01:27:09Z")

</div>

안녕하세요

직접 전체 컨트롤을 돌면서 적용해야 할 것 같습니다.  
아래 코드 참고하시면 좋을 것 같습니다.

감사합니다.

```auto
ctrl = hwp.HeadCtrl
while ctrl is not None:
    if ctrl.CtrlID == "gso": # 그리기 개체(그림)
        prop = ctrl.Properties # 현재 속성 읽기
        w = prop.Item("Width") # 단위는 HWPUNIT
        h = prop.Item("Height")
        prop.SetItem("Width", int(w * 11.8 / 12.7))
        prop.SetItem("Height", int(h * 11.8 / 12.7))
        ctrl.Properties = prop # ★ 수정한 prop을 다시 대입해야 반영됩니다
    ctrl = ctrl.Next

```
