Retrieving an image from the database

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Retrieving an image from the database

Post by BillG » Sat Sep 27, 2014 6:59 pm

I am trying to retrieve my image from the database.

here is what I have so far.

Code: Select all

// retrieves the row in the MemberPhoto table as an object
memberPhoto = Repository.GetMemberPhoto(currentMember.SocSecNo);
if (memberPhoto != null)                          // verifies the valid row was retrieved
{
    byte[] data = memberPhoto.Photo;       // retrieves the image from the field in the object and assigns it to a byte Array

    image = VintasoftImage.FromStream(new MemoryStream(data));
                
    DisplayPhoto(image);
}
Now how do I take it from the bytearray to a vintasoft image ready to be displayed?

BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Re: Retrieving an image from the database

Post by BillG » Sun Sep 28, 2014 3:14 am

figured it out.

Alex
Site Admin
Posts: 1464
Joined: Thu Jul 10, 2008 2:21 pm

Re: Retrieving an image from the database

Post by Alex » Tue Sep 30, 2014 3:43 pm

Hi Bill,
Now how do I take it from the bytearray to a vintasoft image ready to be displayed?
You need retrieve data as byte array from database, add byte array to a MemoryStream and create instance of VintasoftImage class based on memory stream.

Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest