I have a picturebox on my windows form. In this picturebox I'm going to
keeppictures of the employees. I can save the images to my access table
(tblPhoto.PhotoObject)
I want to be able to populate my picturebox with the image of the employee.
How can I go about binding it, or having the image show when I select an
employee?
Craig,
This method turns bytes received from the database into a Bitmap object
which you can display in a picture box like that:
pictureBox.Image = GetPhotos(bits);
public System.Drawing.Bitmap GetPhoto(byte[] photoBits)
{
if (photoBits != null && photoBits.Length > 0)
{
using (MemoryStream stream = new MemoryStream(photoBits))
{
return new Bitmap(stream);
}
}
else
{
// Return standard company approved photo :-)
return null;
}
}
HTH,
Alexander
>I have a picturebox on my windows form. In this picturebox I'm going to
> keeppictures of the employees. I can save the images to my access table
[quoted text clipped - 4 lines]
> How can I go about binding it, or having the image show when I select an
> employee?