Scale image to fit to A4 page - Migradoc

强颜欢笑 提交于 2019-12-05 05:22:04

You call AddImage() to add the image - and in return you get an Image object that allows you to set width and/or height of the image.

What you have to do: check the dimensions of the image, calculate which is the limiting factor (width or height), then set this limiting factor on the Image object and also set LockAspectRatio.

Or set both Width and Height and leave LockAspectRatio off.

For DIN A4, you may allow e.g. 19 cm x 27.7 cm as maximum image size. For an image with 1000x1000 pixel you would set the width to 19 cm (assuming LockAspectRatio is on). Height will then also be 19 cm automatically. For an image with 1000x2000 pixel you would set the height to 27.7 cm. Width will then be 50% of the height.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!