简体   繁体   English

水晶报告图像被压扁

[英]crystal reports image squashed

is there any way in crystal reports(v11, if this matters) to prevent the images from stretching itself to fit in the whole OLE-object? 在水晶报告中是否有任何方法(v11,如果这很重要),以防止图像伸展自身以适应整个OLE对象? im loading the images dynamically from a database and dont know their aspect ratio. 我从数据库动态加载图像,不知道他们的宽高比。

thanks for help. 感谢帮助。

The Crystal OLE object, which shows pictures from files, can only be set programmatically so for a 'pull' type report, where you are supplying a dynamic image name, of either portrait or landscape orientation, at least one of those orientations will get squashed to fit. 显示文件中图片的Crystal OLE对象只能以编程方式设置,因此对于“拉”类型报告,您要提供纵向或横向的动态图像名称,其中至少有一个方向会被压扁适合。 It is better, IMHO, to show thumbnails and then have a calculated hyperlink to show the real picture in some decent viewer. 恕我直言,更好的是显示缩略图,然后有一个计算的超链接,以显示一些像样的观众真实的图片。 You will spend an unreasonable amount of time trying to get the OLE object that shows pictures to understand that your image has a different aspect ratio. 您将花费不合理的时间来尝试获取显示图片的OLE对象,以了解您的图像具有不同的宽高比。 As long as it is at least reasonably legible that may have to suffice. 只要它至少合理清晰可能就足够了。

i found the answer here 我在这里找到了答案

To make the image resize properly, you must perform the following steps in order: 要正确调整图像大小,必须按顺序执行以下步骤:

  1. Set the image's EnableCanGrow to true 将图像的EnableCanGrow设置为true
  2. Calculate and set Width and Height to the needed size 计算并将宽度和高度设置为所需的大小
  3. Set the image's EnableCanGrow to false 将图像的EnableCanGrow设置为false
  4. Fill the DataSet's image object with data 使用数据填充DataSet的图像对象
  5. Continue with normal report processing. 继续正常的报告处理。

If you get these items in the wrong order, or skip an item, you will find that Crystal Reports scales the image in unexpected and unrecoverable ways. 如果以错误的顺序获取这些项目或跳过某个项目,您会发现Crystal Reports以意外和不可恢复的方式缩放图像。

I don't think Crystal can help you. 我不认为Crystal可以帮到你。 Try looking for some kind of command-line based app on the internet which can automically resize pictures (add black space, reduce in a 1:1 ratio, etc). 尝试在互联网上寻找某种基于命令行的应用程序,它可以自动调整图片大小(添加黑色空间,以1:1的比例减少等)。 I'm sure they're out there. 我相信他们在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM