在 Visual Basic 6 中打印位图 [英] Print Bitmap in Visual Basic 6

查看:51
本文介绍了在 Visual Basic 6 中打印位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用 Visual Basic 6.bmp 文件打印到打印机.有谁知道我如何使用 Printer.Print method 来做到这一点?

I needed to print a .bmp file to a printer using Visual Basic 6. Does anyone know how i can do this using the Printer.Print method?

谢谢

推荐答案

必须使用打印机对象的 PaintPicture 方法.示例:

You have to use the PaintPicture method of the printer object. Example:

Printer.PaintPicture LoadPicture(filename), xPosition, yPosition, _
                                    [Width], [Height]

如果您已经在 Image 或 Picture 控件中加载了图片,您可以传递对象的图片引用,而不是再次使用 LoadPicture.请注意,此方法不会自动调整图像大小以适合纸张,您必须自己计算图像的缩放比例.

If you already have a picture loaded in a Image or Picture control, you can pass the Picture reference of the object instead of using LoadPicture a second time. Note that this method does not automatically resize the image to fit on the paper, you will have to figure out how much to scale the image yourself.

编辑 - 有关使用 PaintPicture 方法的更多信息

这篇关于在 Visual Basic 6 中打印位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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