반사 효과 추가

반사 효과를 사용하여 텍스트 만들기

반사 효과는 텍스트 아래에 거울처럼 반사된 이미지를 추가하여 세련되고 현대적인 느낌을 연출합니다. In IronWord, this effect is applied through the ReflectionEffect property of a TextEffect object, which can be customized or used with default settings.

To implement a reflection effect, create a TextStyle and configure its TextEffect property with a Reflection instance. The Reflection class supports default initialization, which applies standard reflection parameters suitable for most use cases. 사용자 지정 반사의 경우 거리, 흐림 정도, 투명도와 같은 속성을 조정하여 모양을 세밀하게 조정할 수 있습니다.

After defining the text style, create a Run containing your TextContent and assign the configured style to the run. Use AddChild to add the run to a paragraph, maintaining the proper document hierarchy of Document → Paragraph → Run → TextContent. 마지막으로, 반사 효과를 적용하려면 해당 단락을 문서에 추가하세요.

코드 설명

새 워드 문서를 만들고 텍스트에 반사 효과를 추가해 보겠습니다. Initially, a new WordDocument object named doc is created. A TextStyle object is then instantiated and configured to include a reflection effect by setting its TextEffect property to a new Reflection object.

To add the styled text with the reflection effect, a Paragraph is created, then a Run object is created containing TextContent with "Hello World". The TextStyle is assigned to the Run, applying the reflection effect. The Run is added to the Paragraph using AddChild, and the Paragraph is added to the document. 이는 문서 계층 구조(문서 → 단락 → 실행 → 텍스트 콘텐츠)를 따릅니다. 마지막으로 문서가 저장됩니다.

IronWord 튜토리얼에서 문서 요소를 살펴보세요.

시작할 준비 되셨나요?
Nuget 다운로드 35,581 | 버전: 2026.3 방금 출시되었습니다
Still Scrolling Icon

아직도 스크롤하고 계신가요?

빠른 증거를 원하시나요? PM > Install-Package IronWord
샘플 실행 데이터를 워드 문서로 변환 확인.