computer 版 (精华区)

发信人: windoe (为中国电信做贡献), 信区: program
标  题: VB:如何用打印机输出一张图片?
发信站: 听涛站 (Fri Mar 10 19:09:04 2000), 转信

先把图片调入窗体中,然后用PaintPicture方法(Method)把图片打印

出来。
Sub PrintPhoto()
Picture1.Picture = LoadPicture(“C:\ABC\1.BMP”)
Printer.PaintPicture Picture1.Picture, Picture1.Left, Picture1.Top, _
Picture1.Width, Picture1.Height, vbMergeCopy
End Sub
Write X, int1,str1
Close X
SaveData=True
End Function
’读取文件操作
Function ReadData(fname$) As Boolean
On Error Resume Next ’设置错误处理
Dim int1 As Integer
Dim str1 As String
Dim X as Integer
X = FreeFile ’取得一个空闲文件句柄
Open fname$ For Input As X ’试图打开该文件
If Err <> 0 Then ’如果打开不成功
ReadData=False
Exit Function
End If
Input X, int1,str1
Close X
ReadData=True
’输入执行结果
Debug.Print int1,str1
End Function



--By Kammi's SuperPost General Version
--

夜中不能寐,起坐弹鸣琴。
    薄帷鉴明月,清风吹我襟。
孤鸿号外野,翔鸟鸣北林。
    徘徊将何见,忧思独伤心。


[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:0.922毫秒