使用GDI +创建的图像未显示在VB6 LeadTools中 [英] Image Created using GDI+ is not showing in VB6 LeadTools

查看:173
本文介绍了使用GDI +创建的图像未显示在VB6 LeadTools中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有使用VB6构建的旧版应用程序.这些应用程序使用铅工具.一切都很好.我们还有另一个.NET流程,可以优化图像(并进行一些水印处理)并将其保存为tiff格式.这是.NET代码的一瞥,

We have legacy applications built using VB6. These applications are using lead-tools. Everything was perfectly working. We have another .NET process that optimizes the image (and do some water-marking) and save it in tiff format. Here is glimpse of .NET code,

        using (var bitmap = new Bitmap(contractWidth, contractHeight))
        {
            using (var canvas = Graphics.FromImage(bitmap))
            {
                 canvas.InterpolationMode = InterpolationMode.Default;
                // Play with canvas

                canvas.Save();
            }
            using (var stream = new MemoryStream())
            {
                bitmap.Save(stream, ImageFormat.Tiff);
                return stream.ToArray();
            }
        }

当我们以tiff格式保存它时(例如image.tif).但是,当我们在VB6项目上打开此文件时,它会显示一个蓝屏.我试图比较有效的图像和无效的图像.这是屏幕,

When we save this in tiff format (say image.tif). But when we open this file on our VB6 project, it shows a blue screen. I tried to compare the image which is working and image which is not working. Here are screens,

工作:

不起作用:

更新:这解决了我的问题将TIFF转换为1bit

Update: This fixed my issue Convert TIFF to 1bit

推荐答案

我知道您已通过将输入图像转换为1位找到了解决问题的方法,但是我想详细说明引起原始问题的原因,首先,LEADTOOLS无法正确打开32位文件.

I know you found a solution to the problem by converting the input image to 1-bit, but I wanted to elaborate more on the cause of the original problem, which is LEADTOOLS not opening the 32-bit file correctly in the first place.

您尚未指定要使用的LEADTOOLS版本,但是由于它是旧版VB6应用程序,因此它可能是一个相当旧的版本(介于v10和v17之间;当前版本为20).

You haven't specified which version of LEADTOOLS you're using, but since it's a legacy VB6 application, it's probably a rather old version (somewhere between v10 and v17; the current version is 20).

无论如何,即使是较旧版本的SDK,打开32位TIFF文件也应该没有问题,但是您的应用程序可能缺少以下一项或两项要求:

In any case, even older versions of the SDK should have no problem opening 32-bit TIFF files, but your application might be missing one or both of the following requirements:

  1. TIFF文件的不同子类型需要不同的LEADTOOLS DLL.帮助主题要包含的文件您的应用程序.

较早版本的SDK需要特殊许可才能支持LZW压缩,这可以追溯到LZW拥有有效专利​​的时代.如果您使用的是这些版本之一,而您的应用程序没有该许可证,则它将不支持LZW tiff或gif文件.

Older versions of the SDK required a special license to support LZW compression, back in the days when there was an active patent on LZW. If you're using one of these versions AND your application does not have that license, it won't support LZW tiff or gif files.

请注意,即使是较早版本的SDK的所有者也可以免费获得支持.因此,如果您是原始SDK的所有者,请随时将任何问题以及您的LEADTOOLS产品序列号通过电子邮件发送至support@leadtools.com.

Please note that even owners of older SDK versions get free support. So if you are the owner of the original SDK, feel free to email any questions to support@leadtools.com, along with your LEADTOOLS product serial number.

这篇关于使用GDI +创建的图像未显示在VB6 LeadTools中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆