Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Display image field

0 views
Skip to first unread message

Gunawan

unread,
Apr 9, 2003, 4:14:51 AM4/9/03
to
Hi,
I have an OLE Object field.
but I could not find a way to display it on the form.
That field should be a picture of the employee.
Could you help me?
TIA
Gun's


Ken Tucker

unread,
Apr 9, 2003, 8:51:04 AM4/9/03
to
Gun,

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...

0 new messages