Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]获取图片路径

1楼
天一生水 发表于:2018/4/16 14:05:00

将PDF文件分解成图片后,并显示在PictureBox控件中,然后对PictureBox控件中当前显示的图片进行识别。

但是如何获取图片的ImageFile,转入第二段代码中运行?

谢谢!

 

'1、将PDF文件分解成图片
Dim Pdfv As new PDFView.ConvertPDF.PDFConvert
Dim pcb As WinForm.PictureBox = e.form.Controls("照片")
Dim rz As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox3")
_pdfWrapper.CurrentPage = rz.text
pcb.Image = _pdfWrapper.Pages(_pdfWrapper.CurrentPage).GetBitmap(pcb.Width, pcb.Height,True)
msgbox(pcb.ImageFile)        ‘获取为空

 

'2、文字识别
If pbx.ImageFile <> "" Then
    Dim doc = CreateObject("MODI.Document")
    doc.Create(pcb.ImageFile)
    doc.OCR(2052, True, True)
    For i As Integer = 0 To doc.Images.count - 1
        Dim layout = doc.images(i).Layout       
    Next i
    doc.close
    doc = Nothing
Else
    msgbox("未添加图片!")
End If

2楼
有点甜 发表于:2018/4/16 14:10:00

1、pcb.Image.Save("d:\test.jpg")

 

2、doc.Create("d:\test.jpg")

3楼
riyuan 发表于:2023/8/29 9:52:00
Dim pbx As WinForm.PictureBox
pbx = Forms("image").Controls("PictureBox1")
Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog 
dlg.Filter = "图片文件|*.jpg|图片文件|*.png"
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
pbx.ImageFile = "D:\dygl\管理项目1\Attachments\czr.jpg"
    MessageBox.Show("你选择的是:" & dlg.FileName, "提示") '提示用户选择的文件
    e.Form.Controls("label1").Text = dlg.FileName
    pbx.Image = GetImage("dlg.FileName")
  pbx.ImageFile = "dlg.FileName\*.jpg"
End If
如果把pbx.ImageFile = "D:\dygl\管理项目1\Attachments\czr.jpg"改成相对路径文件,在图片框中不显示,要如何修改

4楼
riyuan 发表于:2023/8/29 9:53:00
在对话框中选择文件,不在代码中指定文件,要如何才能在图片框中显示图片
共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.