【问题标题】:How to print images in vb6如何在vb6中打印图像
【发布时间】:2018-04-26 17:06:40
【问题描述】:

我在 vb6 应用程序中有 tiff 图像(前后图像)。我正在将 tiff 图像从 fim 和 rim 文件保存到我的本地文件夹中,并从那里尝试打印图像。

最初我尝试将图像加载到 picturecox 并尝试打印图像,但 tiff 图像无法以这种方式打印。我收到错误图片无效。 .bmp 和 .jpg 工作正常。

If pblnFlipped Then
        Set frmnewimage.img.Picture = Nothing
        frmnewimage.img.Picture = LoadPicture(mstrRearTiffImageFile)
        Else
        Set frmnewimage.img.Picture = Nothing
        frmnewimage.img.Picture = LoadPicture(mstrFrontTiffImageFile)
        End If
        Printer.PaintPicture frmnewimage.img.Picture, 100, 100
        Printer.EndDoc

所以我将图片保存到我的本地。但我不明白如何直接从保存的图像中打印图像。请帮帮我。

提前致谢!!!!

我尝试过的:

If pblnFlipped Then
       Printer.PaintPicture mstrRearTiffImageFile, 10, 10
       Else
       Printer.PaintPicture mstrFrontTiffImageFile, 10, 10
       End If
       Printer.EndDoc

mstrRearTiffImageFile 和 mstrFrontTiffImageFile 是字符串(后图像和前图像)。它由我需要打印的图像组成。根据图像类型(pblnFlipped),我需要打印图像。

【问题讨论】:

标签: vb6


【解决方案1】:

内置 VB6 image controlPicture Box control 支持的文件格式不包括对 TIFF 文件的支持。

在将文件加载到 VB6 之前,您需要将文件转换为受支持的图像格式,或者创建或找到一些其他支持 TIFF 格式的自定义控件。

我不知道您为什么要在 VB6 中进行新开发,但您可能会发现使用具有更广泛图形支持的其他平台更容易实现您的目标,然后从您的任何 VB 代码中调用它维护。

【讨论】:

    猜你喜欢
    • 2014-03-25
    • 2017-10-16
    • 1970-01-01
    • 2015-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-10
    相关资源
    最近更新 更多