谢谢老师指点,我将我的代码发上来,和大家共勉,如果什么地方可以改进的,也请老师和坛友们指点哈:
表属性——DrawCell事件代码:
If e.Col.Name = "品牌_logo" AndAlso e.Row.IsNull("品牌_图片") = False Then
Dim nm As String = e.Row("品牌_图片")
If FileSys.FileExists(Vars("附件路径") & nm) Then
If e.Width > 2 AndAlso e.Height > 2 Then
Dim img = getimage(Vars("附件路径") & nm)
Dim w1 As Integer = img.width
Dim h1 As Integer = img.height
Dim h2 As Integer = e.Height - 2
Dim w2 As Integer = w1 * h2 / h1
e.StartDraw()
e.Graphics.DrawImage(img, e.x + 1,e.y + 1,w2,h2)
e.EndDraw()
End If
End If
End If
[此贴子已经被作者于2016/3/7 16:52:41编辑过]