Why images in Crystal Report with white background

2019-03-12 10:05发布

I'm putting an image in a crystal report (using Crystal Reports for Visual Studio 2005). The image is a product logo with a white background, and the report has a white background too. But when I run the report you can see it's not quite white. The off-white color is barely visible, but it is visible and more so when printed.

I've tried a variety of image formats, and tried transparent images too but they don't seem to work (transparent pixels show as black). When I use a different image I notice that the faint non-white color changes - as if it's a function of the colors in the image.

Anyone else encountered this? Any suggestions?

6条回答
该账号已被封号
2楼-- · 2019-03-12 10:20

Take a look at this http://kenhamady.com/cru/archives/1480

When I export a png from Photoshop using "Save for Web & Devices" The white color photoshop was picking was actually 1/0/0/0 (CMYK).

In photoshop you can edit these colors before saving, I changed this color to be completely white which seemed to fix my issue.

Programmatically I found reducing the image to 16 bit color resolved the issue

Bitmap result = new Bitmap((int)250, (int)123, System.Drawing.Imaging.PixelFormat.Format16bppRgb555);
查看更多
Fickle 薄情
3楼-- · 2019-03-12 10:22

Solution to this problem is using images with low color depth. It worked for 8bit PNGs.

查看更多
forever°为你锁心
4楼-- · 2019-03-12 10:33

If you are generating your own images with Adobe Fireworks you will need to export the image as 8-bit PNG. You can do it using the export tool then in the Options tab change the format to PNG 8 as show in the screenshot below:

enter image description here

If your image doesn't have too much color swatches (< 256) this will not affect the quality, otherwise yes.

查看更多
可以哭但决不认输i
5楼-- · 2019-03-12 10:41

It can be solved directly in the report by checking the option: Retain Original Image Color Depth.

The docs says:

If you want images in your report to keep their original color depth when they are encapsulated, select this option. Otherwise, all images are converted to 8 bits per pixel before being encapsulated.

To check this option go to:

File -> Report Options -> Retain Original Image Color Depth.

查看更多
姐就是有狂的资本
6楼-- · 2019-03-12 10:45

It sounds as though the white in the image is actually off-white - have you tried printing the image from another app, such as a browser?

查看更多
我想做一个坏孩纸
7楼-- · 2019-03-12 10:46

I found that even in Crystal Reports for Visual Studio 2012 images need to be of a lower color depth than what is defaulted by many modern editors. High Res images display horribly in the crystal report viewer.

Quick Fix

In GIMP -> Image Menu -> Mode -> Select Indexed As Color Mode

In Index Color Conversion Window

Use Web Optimized pallet.



Ta da. Enjoy.

查看更多
登录 后发表回答