我把代码贴出来
。很简单的一段导出图片
Dim intsuc As Integer = -2
Try
Dim strfilename As String = "pic"
Dim vdlg As New SaveFileDialog
With vdlg
.Filter = "所有文件|*.*|图片|*.Jpg|图片|*.bmp"
.ShowDialog()
strfilename = .FileName
If Len(strfilename) > 0 Then
C1Img1.Image.Save(strfilename,ImageFormat.Jpeg)
End If
End With
intsuc = 1
Catch ex As Exception
MsgBox(ex.Message, , "错误")
End Try
Return intsuc
加载图片时。
表b_material_photo ,存图片的字段是b_photo
dim dt as new datatable
c1img1.datasource=dt
c1img1.datafield="b_photo"
|