我将图片所有信息存到了ACCESS的OLE字段中了,现在想把图片及一些个人信息读出来形成一个类似于报告的东西,然后进行打印但不知道该怎么弄,请各位高手出出主意。。。
不好意思,我没讲清楚,图片现在已经可以读出来并在picturebox中显示,我现在的主要问题是打印,怎么形成一个报告并能进行预览,打印
123ym123说的这个注意不错啊。。。呵呵,正常一点好不好!
这个分就送给47677447了,虽然不是我要的结果。
分数没法分开给,请大家谅解啊
vb打印数据库中的图片
答案:3 悬赏:30 手机版
解决时间 2021-02-01 13:00
- 提问者网友:刺鸟
- 2021-02-01 01:41
最佳答案
- 五星知识达人网友:末日狂欢
- 2021-02-01 02:33
我有试过 先把 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
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
全部回答
- 1楼网友:詩光轨車
- 2021-02-01 04:52
你还是借助报表工具吧
比如水晶报表 或者acticereport等等
- 2楼网友:神鬼未生
- 2021-02-01 03:37
1、在窗体中用picture 控件做为数据库中图片字段的呈现控件
picture.datasource =数据控件 (如:data)
picture.datafield =字段名
2、直接打印图片
printer.paintpicture picture, 0, 0
printer.enddoc
这样就直接打印出图片了
printer.paintpicture 命令参数可以自己设置,确定图片的打印位置(x,y坐标)及图片是否缩放...
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯