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

查看:23
本文介绍了使用 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

推荐答案

我知道您通过将输入图像转换为 1-bit 找到了问题的解决方案,但我想详细说明原始问题的原因,这是 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 的所有者,请随时将任何问题发送至 support@leadtools.com,并附上您的 LEADTOOLS 产品序列号.

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天全站免登陆