I made an inherited control from a picturebox to bind pictures to a
database. I added a ByteImage property to the picturebox. I set the
Browsable attribute to false so it would not show in the properties box.
Here is the code.
Public Class VideoCaptureBox
Inherits System.Windows.Forms.PictureBox
Private bm As New Bitmap(1, 1)
<Bindable(True), Browsable(False)> _
Public Property ByteImage()
Get
Dim ms As New MemoryStream()
Me.Image.Save(ms, Imaging.ImageFormat.Jpeg)
Return ms.GetBuffer
End Get
Set(ByVal Value)
Try
Dim ms As New MemoryStream()
Dim bmap As Bitmap
ms.Write(Value, 0, Value.Length)
bmap = New Bitmap(ms)
img = bmap
Me.Image = bmap
Catch
img = bm
Me.Image = img
End Try
End Set
End Property
End Class
Hope it helps
Ken
----------------------------------------------------------
"Gunawan" <jguna...@hotmail.com> wrote in message
news:ujkEm5m$CHA....@TK2MSFTNGP11.phx.gbl...