Hi
Thanks for that pointer....
It provided a 98% solution...
Some comments were in German and the code was C# but after some further frustration a resul
was achieved in vb.net (shown below)
Once again thanks to ClayB and yourself... Great Help... Much appreciated..
Regards...
VB.Net Solution (or at least the significant bits)
Still some tinkering at the edges yet to do but the problem o
getting the image from SQL Server and displaying in the grid has been resolved
The three 'Paint' overrides are
Protected Overloads Overrides Sub Paint(ByVal g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal source As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer
Dim backBrush As SolidBrush = New SolidBrush(Color.White
Dim byteArray() As Byte = getcolumnvalueatrow(source, rowNum
Dim imagePic As Bitmap = extractImage(byteArray
With
.FillRectangle(backBrush, bounds.X, bounds.Y, bounds.Width, bounds.Height
..DrawImage(imagePic, bounds.X, bounds.Y, imagePic.Width, imagePic.Height
End Wit
'/
End Su
Protected Overloads Overrides Sub Paint(ByVal g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal source As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal alignToRight As Boolean
Dim backBrush As SolidBrush = New SolidBrush(Color.White
Dim byteArray() As Byte = getcolumnvalueatrow(source, rowNum
Dim imagePic As Bitmap = extractImage(byteArray
With
..FillRectangle(backBrush, bounds.X, bounds.Y, bounds.Width, bounds.Height
..DrawImage(imagePic, bounds.X, bounds.Y, imagePic.Width, imagePic.Height
End Wit
'/
End Su
Protected Overloads Overrides Sub Paint(ByVal g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal source As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal BackBrush As Brush, ByVal ForeBrush As Brush, ByVal alignToRight As Boolean
Dim byteArray() As Byte = getcolumnvalueatrow(source, rowNum
Dim imagePic As Bitmap = extractImage(byteArray
With
..FillRectangle(BackBrush, bounds.X, bounds.Y, bounds.Width, bounds.Height
..DrawImage(imagePic, bounds.X, bounds.Y, imagePic.Width, imagePic.Height
End Wit
'/
End Su
'/
'/
'// The all important function cal
'/
'/
Private Function extractImage(ByVal Data() As Byte) As Bitma
Dim imageArray(Data.Length - 1) As Byt
Dim stream As IO.MemoryStrea
Tr
System.Buffer.BlockCopy(Data, 0, imageArray, 0, Data.Length
Catch ex As Exceptio
'// error handlin
End Tr
'/
stream = New IO.MemoryStream(imageArray
'/
extractImage = New Bitmap(stream
'/
End Functio
'/
'// PS some imports that you'll nee
Imports Syste
Imports System.Drawin
Imports System.Windows.Form
Imports System.Resource
Imports System.ComponentMode