mr_john

Untitled

Nov 2nd, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.57 KB | None | 0 0
  1.  
  2.   Dim WithEvents bind As Binding
  3. .....
  4.         bind = New Binding("Image", bSource_, "F_IMAG")
  5.         Me.PictureBox1.DataBindings.Add(bind)
  6.  
  7. .....
  8.  
  9.     Private Sub Binding_Format(ByVal sender As System.Object, ByVal e As ConvertEventArgs) Handles bind.Format
  10.         Dim img As Byte()
  11.         img = CType(e.Value, Byte())   'Unable to cast object of type 'System.String' to type 'System.Byte[]'.
  12.        
  13.         If (Not img Is Nothing) Then
  14.             e.Value = Image.FromStream(New System.IO.MemoryStream(img))
  15.         End If
  16.     End Sub
  17.  
  18.  
  19. thanks for any help !
Advertisement
Add Comment
Please, Sign In to add comment