VB打印图片
发布网友
发布时间:2022-05-07 11:03
我来回答
共4个回答
热心网友
时间:2023-10-27 21:39
Printer.PaintPicture Picture1.Picture,0,0,Picture1.Width,Picture1.Height
Printer.EdnDoc'如果你想结束打印的话
试下上面的代码,注意修正图片的大小,不要超过打印机(源,后面还有几个参数)*,否则会被压缩或者拉伸。
下面是PaintPiture的原型
object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode
热心网友
时间:2023-10-27 21:39
最简单的,把picture控件设置为窗体大小,直接打印窗体即可,只需一行代码:
Printform
热心网友
时间:2023-10-27 21:40
我有试过 先把 longraw 转换成图片然后在加载到inage 不过图片大的话蛮慢的
Private Sub writefile()
Dim iStm As ADODB.Stream
Dim strings As String
gSQL = "select PIC from iqc_masklist where Part_no='AAA' and pic is not null "
Set gadoRS = gadoCN.Execute(gSQL)
If gadoRS.RecordCount > 0 Then
Set iStm = New ADODB.Stream
With iStm
.Mode = adModeReadWrite
.Type = adTypeBinary
.Open
.Write gadoRS("PIC")
If Len(Dir$(PictBmp)) > 0 Then
Kill PictBmp
End If
.SaveToFile "D:\temp.jpg"
End With
Image1.Picture = LoadPicture("D:\temp.jpg")
iStm.Close
End If
gadoRS.Close
End Sub
热心网友
时间:2023-10-27 21:39
Printer.PaintPicture Picture1.Picture,0,0,Picture1.Width,Picture1.Height
Printer.EdnDoc'如果你想结束打印的话
试下上面的代码,注意修正图片的大小,不要超过打印机(源,后面还有几个参数)*,否则会被压缩或者拉伸。
下面是PaintPiture的原型
object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode
热心网友
时间:2023-10-27 21:39
最简单的,把picture控件设置为窗体大小,直接打印窗体即可,只需一行代码:
Printform
热心网友
时间:2023-10-27 21:40
我有试过 先把 longraw 转换成图片然后在加载到inage 不过图片大的话蛮慢的
Private Sub writefile()
Dim iStm As ADODB.Stream
Dim strings As String
gSQL = "select PIC from iqc_masklist where Part_no='AAA' and pic is not null "
Set gadoRS = gadoCN.Execute(gSQL)
If gadoRS.RecordCount > 0 Then
Set iStm = New ADODB.Stream
With iStm
.Mode = adModeReadWrite
.Type = adTypeBinary
.Open
.Write gadoRS("PIC")
If Len(Dir$(PictBmp)) > 0 Then
Kill PictBmp
End If
.SaveToFile "D:\temp.jpg"
End With
Image1.Picture = LoadPicture("D:\temp.jpg")
iStm.Close
End If
gadoRS.Close
End Sub
热心网友
时间:2023-10-27 21:40
我有试过 先把 longraw 转换成图片然后在加载到inage 不过图片大的话蛮慢打开图片-文件
热心网友
时间:2023-10-27 21:39
Printer.PaintPicture Picture1.Picture,0,0,Picture1.Width,Picture1.Height
Printer.EdnDoc'如果你想结束打印的话
试下上面的代码,注意修正图片的大小,不要超过打印机(源,后面还有几个参数)*,否则会被压缩或者拉伸。
下面是PaintPiture的原型
object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode
热心网友
时间:2023-10-27 21:40
我有试过 先把 longraw 转换成图片然后在加载到inage 不过图片大的话蛮慢打开图片-文件
热心网友
时间:2023-10-27 21:39
最简单的,把picture控件设置为窗体大小,直接打印窗体即可,只需一行代码:
Printform
热心网友
时间:2023-10-27 21:40
我有试过 先把 longraw 转换成图片然后在加载到inage 不过图片大的话蛮慢的
Private Sub writefile()
Dim iStm As ADODB.Stream
Dim strings As String
gSQL = "select PIC from iqc_masklist where Part_no='AAA' and pic is not null "
Set gadoRS = gadoCN.Execute(gSQL)
If gadoRS.RecordCount > 0 Then
Set iStm = New ADODB.Stream
With iStm
.Mode = adModeReadWrite
.Type = adTypeBinary
.Open
.Write gadoRS("PIC")
If Len(Dir$(PictBmp)) > 0 Then
Kill PictBmp
End If
.SaveToFile "D:\temp.jpg"
End With
Image1.Picture = LoadPicture("D:\temp.jpg")
iStm.Close
End If
gadoRS.Close
End Sub
热心网友
时间:2023-10-27 21:40
我有试过 先把 longraw 转换成图片然后在加载到inage 不过图片大的话蛮慢打开图片-文件